@ckeditor/ckeditor5-collaboration-core 38.1.1 → 38.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/augmentation.d.ts +34 -34
- package/src/collaborationhistory.d.ts +17 -17
- package/src/collaborationoperation.d.ts +24 -24
- package/src/config.d.ts +98 -98
- package/src/index.d.ts +14 -13
- package/src/index.js +1 -1
- package/src/permissions.d.ts +41 -41
- package/src/permissions.js +1 -1
- package/src/suggestionstyles.d.ts +8 -8
- package/src/users/view/userview.d.ts +12 -12
- package/src/users/view/userview.js +1 -1
- package/src/users.d.ts +146 -146
- package/src/users.js +1 -1
- package/src/utils/common-translations.d.ts +5 -5
- package/src/utils/common-translations.js +1 -1
- package/src/utils/confirmmixin.d.ts +16 -16
- package/src/utils/confirmmixin.js +1 -1
- package/src/utils/confirmview.d.ts +9 -9
- package/src/utils/confirmview.js +1 -1
- package/src/utils/getdatetimeformatter.d.ts +29 -29
- package/src/utils/getdatetimeformatter.js +1 -1
- package/src/utils/getmarkerdomelement.d.ts +21 -21
- package/src/utils/getmarkerdomelement.js +1 -1
- package/src/utils/hashobject.d.ts +4 -4
- package/src/utils/hashobject.js +1 -1
- package/src/utils/sanitizeEditorConfig.d.ts +11 -0
- package/src/utils/sanitizeEditorConfig.js +23 -0
- package/src/utils/trim-html.d.ts +12 -12
- package/src/utils/trim-html.js +1 -1
package/src/users.d.ts
CHANGED
@@ -1,146 +1,146 @@
|
|
1
|
-
/**
|
2
|
-
* @module collaboration-core/users
|
3
|
-
* @publicApi
|
4
|
-
*/
|
5
|
-
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
|
6
|
-
import { Collection } from 'ckeditor5/src/utils';
|
7
|
-
import Permissions from './permissions';
|
8
|
-
import '../theme/usercolors.css';
|
9
|
-
/**
|
10
|
-
* The `Users` plugin provides the basic interface for setting and getting users involved in the document editing process.
|
11
|
-
*/
|
12
|
-
export default class Users extends ContextPlugin {
|
13
|
-
licenseKey: string;
|
14
|
-
/**
|
15
|
-
* Holds all {@link module:collaboration-core/users~User users} added to the editor.
|
16
|
-
*
|
17
|
-
* ```ts
|
18
|
-
* for ( const user of editor.plugins.get( 'Users' ).users ) {
|
19
|
-
* console.log( user.name );
|
20
|
-
* }
|
21
|
-
* ```
|
22
|
-
*
|
23
|
-
* Use {@link #addUser} to add a new user.
|
24
|
-
*/
|
25
|
-
readonly users: Collection<User>;
|
26
|
-
/**
|
27
|
-
* @inheritDoc
|
28
|
-
*/
|
29
|
-
static get pluginName(): "Users";
|
30
|
-
/**
|
31
|
-
* @inheritDoc
|
32
|
-
*/
|
33
|
-
static get requires(): readonly [typeof Permissions];
|
34
|
-
/**
|
35
|
-
* @inheritDoc
|
36
|
-
*/
|
37
|
-
constructor(context: Context | Editor);
|
38
|
-
/**
|
39
|
-
* @inheritDoc
|
40
|
-
*/
|
41
|
-
init(): void;
|
42
|
-
/**
|
43
|
-
* A reference to the local user or `null` if it has not been set.
|
44
|
-
*/
|
45
|
-
get me(): User | null;
|
46
|
-
/**
|
47
|
-
* Adds a new user to the list of users.
|
48
|
-
*/
|
49
|
-
addUser({ id, name, ...additionalData }: Partial<UserData>): User;
|
50
|
-
/**
|
51
|
-
* Returns the user with a given ID.
|
52
|
-
*/
|
53
|
-
getUser(id: string): User | null;
|
54
|
-
/**
|
55
|
-
* Sets an anonymous user as {@link #me}.
|
56
|
-
*
|
57
|
-
* The user's ID will be set to the value of `config.users.anonymousUserId` property.
|
58
|
-
*/
|
59
|
-
useAnonymousUser(): void;
|
60
|
-
/**
|
61
|
-
* Sets the user with the given ID as the local user ({@link #me}).
|
62
|
-
*
|
63
|
-
* The local user can be only set once (this includes setting anonymous as the local user).
|
64
|
-
*/
|
65
|
-
defineMe(userId: string): void;
|
66
|
-
/**
|
67
|
-
* Returns the author of the operation. It returns {@link #me} by default if it is not overwritten.
|
68
|
-
*/
|
69
|
-
getOperationAuthor(): User | null;
|
70
|
-
/**
|
71
|
-
* @inheritDoc
|
72
|
-
*/
|
73
|
-
destroy(): void;
|
74
|
-
}
|
75
|
-
/**
|
76
|
-
* The representation of a single user that is involved in document editing.
|
77
|
-
*/
|
78
|
-
export declare class User {
|
79
|
-
/**
|
80
|
-
* The ID of the user.
|
81
|
-
*/
|
82
|
-
id: string;
|
83
|
-
/**
|
84
|
-
* CSS colors classes object for the user.
|
85
|
-
*/
|
86
|
-
color: Color;
|
87
|
-
/**
|
88
|
-
* The name of the user.
|
89
|
-
*/
|
90
|
-
name: string;
|
91
|
-
/**
|
92
|
-
* The URL pointing to the image with the avatar of the user.
|
93
|
-
*
|
94
|
-
* If avatar is not set, default avatar is used.
|
95
|
-
*/
|
96
|
-
avatar: string | undefined;
|
97
|
-
/**
|
98
|
-
* @param data User data.
|
99
|
-
* @param data.id The ID of the user.
|
100
|
-
* @param data.color A helper object to generate CSS classes with the user color in the UI.
|
101
|
-
* @param data.name The name of the user.
|
102
|
-
* @param data.avatar The URL to the user avatar.
|
103
|
-
*/
|
104
|
-
constructor(data: UserData);
|
105
|
-
/**
|
106
|
-
* Is `true` for the anonymous user, `false` otherwise.
|
107
|
-
*/
|
108
|
-
get isAnonymous(): boolean;
|
109
|
-
/**
|
110
|
-
* The initials of the user.
|
111
|
-
*
|
112
|
-
* The initials are composed from the user name's first and last words:
|
113
|
-
*
|
114
|
-
* * for `Joe Doe`, the initials are `JD`,
|
115
|
-
* * for `Anonymous` the initials are `A`,
|
116
|
-
* * for `Katie John-Newman` the initials are `KJ`,
|
117
|
-
* * for `Adam Daniel Smith` the initials are `AS`.
|
118
|
-
*/
|
119
|
-
get initials(): string;
|
120
|
-
}
|
121
|
-
/**
|
122
|
-
* The color object used to generate specified CSS classes with an individual color number assigned to the user.
|
123
|
-
*/
|
124
|
-
declare class Color {
|
125
|
-
constructor(colorId: number);
|
126
|
-
/**
|
127
|
-
* Returns CSS class for user avatar background color.
|
128
|
-
*/
|
129
|
-
getBackgroundColorClass(): string;
|
130
|
-
/**
|
131
|
-
* Returns CSS class for user selection highlight (the selected range).
|
132
|
-
*/
|
133
|
-
getSelectionClass(): string;
|
134
|
-
/**
|
135
|
-
* Returns CSS class for user caret position element (the pipe).
|
136
|
-
*/
|
137
|
-
getMarkerClass(): string;
|
138
|
-
}
|
139
|
-
type UserData = {
|
140
|
-
id: string;
|
141
|
-
color: Color;
|
142
|
-
name: string;
|
143
|
-
avatar?: string;
|
144
|
-
_isAnonymous?: boolean;
|
145
|
-
};
|
146
|
-
export {};
|
1
|
+
/**
|
2
|
+
* @module collaboration-core/users
|
3
|
+
* @publicApi
|
4
|
+
*/
|
5
|
+
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core.js';
|
6
|
+
import { Collection } from 'ckeditor5/src/utils.js';
|
7
|
+
import Permissions from './permissions.js';
|
8
|
+
import '../theme/usercolors.css';
|
9
|
+
/**
|
10
|
+
* The `Users` plugin provides the basic interface for setting and getting users involved in the document editing process.
|
11
|
+
*/
|
12
|
+
export default class Users extends ContextPlugin {
|
13
|
+
licenseKey: string;
|
14
|
+
/**
|
15
|
+
* Holds all {@link module:collaboration-core/users~User users} added to the editor.
|
16
|
+
*
|
17
|
+
* ```ts
|
18
|
+
* for ( const user of editor.plugins.get( 'Users' ).users ) {
|
19
|
+
* console.log( user.name );
|
20
|
+
* }
|
21
|
+
* ```
|
22
|
+
*
|
23
|
+
* Use {@link #addUser} to add a new user.
|
24
|
+
*/
|
25
|
+
readonly users: Collection<User>;
|
26
|
+
/**
|
27
|
+
* @inheritDoc
|
28
|
+
*/
|
29
|
+
static get pluginName(): "Users";
|
30
|
+
/**
|
31
|
+
* @inheritDoc
|
32
|
+
*/
|
33
|
+
static get requires(): readonly [typeof Permissions];
|
34
|
+
/**
|
35
|
+
* @inheritDoc
|
36
|
+
*/
|
37
|
+
constructor(context: Context | Editor);
|
38
|
+
/**
|
39
|
+
* @inheritDoc
|
40
|
+
*/
|
41
|
+
init(): void;
|
42
|
+
/**
|
43
|
+
* A reference to the local user or `null` if it has not been set.
|
44
|
+
*/
|
45
|
+
get me(): User | null;
|
46
|
+
/**
|
47
|
+
* Adds a new user to the list of users.
|
48
|
+
*/
|
49
|
+
addUser({ id, name, ...additionalData }: Partial<UserData>): User;
|
50
|
+
/**
|
51
|
+
* Returns the user with a given ID.
|
52
|
+
*/
|
53
|
+
getUser(id: string): User | null;
|
54
|
+
/**
|
55
|
+
* Sets an anonymous user as {@link #me}.
|
56
|
+
*
|
57
|
+
* The user's ID will be set to the value of `config.users.anonymousUserId` property.
|
58
|
+
*/
|
59
|
+
useAnonymousUser(): void;
|
60
|
+
/**
|
61
|
+
* Sets the user with the given ID as the local user ({@link #me}).
|
62
|
+
*
|
63
|
+
* The local user can be only set once (this includes setting anonymous as the local user).
|
64
|
+
*/
|
65
|
+
defineMe(userId: string): void;
|
66
|
+
/**
|
67
|
+
* Returns the author of the operation. It returns {@link #me} by default if it is not overwritten.
|
68
|
+
*/
|
69
|
+
getOperationAuthor(): User | null;
|
70
|
+
/**
|
71
|
+
* @inheritDoc
|
72
|
+
*/
|
73
|
+
destroy(): void;
|
74
|
+
}
|
75
|
+
/**
|
76
|
+
* The representation of a single user that is involved in document editing.
|
77
|
+
*/
|
78
|
+
export declare class User {
|
79
|
+
/**
|
80
|
+
* The ID of the user.
|
81
|
+
*/
|
82
|
+
id: string;
|
83
|
+
/**
|
84
|
+
* CSS colors classes object for the user.
|
85
|
+
*/
|
86
|
+
color: Color;
|
87
|
+
/**
|
88
|
+
* The name of the user.
|
89
|
+
*/
|
90
|
+
name: string;
|
91
|
+
/**
|
92
|
+
* The URL pointing to the image with the avatar of the user.
|
93
|
+
*
|
94
|
+
* If avatar is not set, default avatar is used.
|
95
|
+
*/
|
96
|
+
avatar: string | undefined;
|
97
|
+
/**
|
98
|
+
* @param data User data.
|
99
|
+
* @param data.id The ID of the user.
|
100
|
+
* @param data.color A helper object to generate CSS classes with the user color in the UI.
|
101
|
+
* @param data.name The name of the user.
|
102
|
+
* @param data.avatar The URL to the user avatar.
|
103
|
+
*/
|
104
|
+
constructor(data: UserData);
|
105
|
+
/**
|
106
|
+
* Is `true` for the anonymous user, `false` otherwise.
|
107
|
+
*/
|
108
|
+
get isAnonymous(): boolean;
|
109
|
+
/**
|
110
|
+
* The initials of the user.
|
111
|
+
*
|
112
|
+
* The initials are composed from the user name's first and last words:
|
113
|
+
*
|
114
|
+
* * for `Joe Doe`, the initials are `JD`,
|
115
|
+
* * for `Anonymous` the initials are `A`,
|
116
|
+
* * for `Katie John-Newman` the initials are `KJ`,
|
117
|
+
* * for `Adam Daniel Smith` the initials are `AS`.
|
118
|
+
*/
|
119
|
+
get initials(): string;
|
120
|
+
}
|
121
|
+
/**
|
122
|
+
* The color object used to generate specified CSS classes with an individual color number assigned to the user.
|
123
|
+
*/
|
124
|
+
declare class Color {
|
125
|
+
constructor(colorId: number);
|
126
|
+
/**
|
127
|
+
* Returns CSS class for user avatar background color.
|
128
|
+
*/
|
129
|
+
getBackgroundColorClass(): string;
|
130
|
+
/**
|
131
|
+
* Returns CSS class for user selection highlight (the selected range).
|
132
|
+
*/
|
133
|
+
getSelectionClass(): string;
|
134
|
+
/**
|
135
|
+
* Returns CSS class for user caret position element (the pipe).
|
136
|
+
*/
|
137
|
+
getMarkerClass(): string;
|
138
|
+
}
|
139
|
+
type UserData = {
|
140
|
+
id: string;
|
141
|
+
color: Color;
|
142
|
+
name: string;
|
143
|
+
avatar?: string;
|
144
|
+
_isAnonymous?: boolean;
|
145
|
+
};
|
146
|
+
export {};
|
package/src/users.js
CHANGED
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
const
|
23
|
+
const _0x2d8a=['users-add-invalid-id','initials','charAt','ck-user__marker--','_id','trial-license-key-reached-limit-changes','context','init','length','split','getMarkerClass','_isAnonymous','_addAnonymousUser','trim','_getNextColor','_myId','licenseKeyValid','toUpperCase','requires','users.colorsCount','users-me-missing-user','get','users-me-already-defined','avatar','_lastColor','isAnonymous','includes','Users','Anonymous','string','define','has','pluginName','licenseKeyTrialLimit:time','users.anonymousUserId','users-add-duplicated-id','config','invalid-license-key','color','_getInitial','name','getUser','licenseKeyTrialLimit:revisions','licenseKey','decorate','_locale','destroy','ck-user__bg-color--','licenseKeyInvalid','trial-license-key-reached-limit-revisions','ck-user__selection--','_licenseKeyCheckInterval','defineMe','add','getOperationAuthor','users','addUser'];(function(_0x4b8337,_0x2d8a79){const _0x16b7ae=function(_0x26bb8e){while(--_0x26bb8e){_0x4b8337['push'](_0x4b8337['shift']());}};_0x16b7ae(++_0x2d8a79);}(_0x2d8a,0x1a1));const _0x16b7=function(_0x4b8337,_0x2d8a79){_0x4b8337=_0x4b8337-0x0;let _0x16b7ae=_0x2d8a[_0x4b8337];return _0x16b7ae;};import{ContextPlugin as _0x382a63}from'ckeditor5/src/core.js';import{Collection as _0x1fd6b2,CKEditorError as _0x42dbba}from'ckeditor5/src/utils.js';import _0x356d16 from'./permissions.js';import{getTranslation as _0x279fea}from'./utils/common-translations.js';import'../theme/usercolors.css';export default class l extends _0x382a63{static get[_0x16b7('0xe')](){return _0x16b7('0x9');}static get[_0x16b7('0x0')](){return[_0x356d16];}constructor(_0x2ab7e3){super(_0x2ab7e3),this[_0x16b7('0x2d')][_0x16b7('0x12')][_0x16b7('0xc')](_0x16b7('0x10'),'anonymous-user'),this[_0x16b7('0x2d')][_0x16b7('0x12')]['define'](_0x16b7('0x1'),0x8),this['users']=new _0x1fd6b2(),this[_0x16b7('0x1b')]=_0x2ab7e3['locale'],this['_licenseKeyCheckInterval']=null,this['_lastColor']=0x0,this['_myId']=null,this[_0x16b7('0x1a')](_0x16b7('0x24'));}[_0x16b7('0x2e')](){const _0x2c6126=this[_0x16b7('0x2d')];this[_0x16b7('0x19')]=_0x2c6126[_0x16b7('0x12')][_0x16b7('0x3')](_0x16b7('0x19'));const _0x432aa1=['licenseKeyTrial',_0x16b7('0x1e'),_0x16b7('0x37'),'licenseKeyTrialLimit:operations',_0x16b7('0xf'),_0x16b7('0x18')];this[_0x16b7('0x21')]=setInterval(()=>{let _0x4fe845;for(const _0x577d36 in _0x2c6126){const _0x2a636d=_0x2c6126[_0x577d36];if(_0x432aa1[_0x16b7('0x8')](_0x2a636d)){delete _0x2c6126[_0x577d36],_0x4fe845=_0x2a636d;break;}}if(_0x16b7('0x1e')===_0x4fe845)throw clearInterval(this[_0x16b7('0x21')]),new _0x42dbba(_0x16b7('0x13'),null);if('licenseKeyTrial'===_0x4fe845&&console['info']('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.'),'licenseKeyTrialLimit:operations'===_0x4fe845)throw clearInterval(this[_0x16b7('0x21')]),new _0x42dbba(_0x16b7('0x2c'),null);if('licenseKeyTrialLimit:time'===_0x4fe845)throw clearInterval(this[_0x16b7('0x21')]),new _0x42dbba('trial-license-key-reached-limit-time',null);if('licenseKeyTrialLimit:revisions'===_0x4fe845)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x42dbba(_0x16b7('0x1f'),null);_0x16b7('0x37')===_0x4fe845&&clearInterval(this[_0x16b7('0x21')]);},0x3e8),this['_addAnonymousUser']();}get['me'](){return null==this[_0x16b7('0x36')]?null:this[_0x16b7('0x17')](this['_myId']);}[_0x16b7('0x26')]({id:_0x38d4f0,name:_0x552852,..._0x28cbeb}){if(!_0x38d4f0||_0x16b7('0xb')!=typeof _0x38d4f0)throw new _0x42dbba(_0x16b7('0x27'));if(this['users'][_0x16b7('0xd')](_0x38d4f0))throw new _0x42dbba(_0x16b7('0x11'),null,{'id':_0x38d4f0});const _0xd077e5={..._0x28cbeb,'id':_0x38d4f0,'name':a(this[_0x16b7('0x1b')],_0x552852),'color':this['_getNextColor']()};_0xd077e5[_0x16b7('0x16')]=a(this[_0x16b7('0x1b')],_0xd077e5[_0x16b7('0x16')]);const _0x424dd6=new User(_0xd077e5);return this[_0x16b7('0x25')][_0x16b7('0x23')](_0x424dd6),_0x424dd6;}[_0x16b7('0x17')](_0x55e519){return this[_0x16b7('0x25')][_0x16b7('0x3')](_0x55e519);}['useAnonymousUser'](){const _0x131cb9=this['context'][_0x16b7('0x12')]['get'](_0x16b7('0x10'));this[_0x16b7('0x36')]||this[_0x16b7('0x22')](_0x131cb9);}[_0x16b7('0x22')](_0x1a0876){if(this[_0x16b7('0x36')])throw new _0x42dbba(_0x16b7('0x4'),null);if(!this[_0x16b7('0x17')](_0x1a0876))throw new _0x42dbba(_0x16b7('0x2'),null);this[_0x16b7('0x36')]=_0x1a0876;}[_0x16b7('0x24')](){return this['me'];}['destroy'](){super[_0x16b7('0x1c')](),clearInterval(this[_0x16b7('0x21')]);}[_0x16b7('0x35')](){const _0x3f5964=this[_0x16b7('0x2d')]['config']['get']('users.colorsCount');return this[_0x16b7('0x6')]>=_0x3f5964&&(this['_lastColor']=0x0),new u(this[_0x16b7('0x6')]++);}[_0x16b7('0x33')](){const _0x53f4db=this[_0x16b7('0x2d')][_0x16b7('0x12')][_0x16b7('0x3')](_0x16b7('0x10'));this[_0x16b7('0x26')]({'id':_0x53f4db,'name':_0x279fea(this[_0x16b7('0x1b')],_0x16b7('0xa'))})[_0x16b7('0x32')]=!0x0;}}export class User{constructor(_0xab11de){this['id']=_0xab11de['id'],this['color']=_0xab11de[_0x16b7('0x14')],this['name']=_0xab11de[_0x16b7('0x16')],this[_0x16b7('0x5')]=_0xab11de[_0x16b7('0x5')],this[_0x16b7('0x32')]=!0x1;}get[_0x16b7('0x7')](){return this[_0x16b7('0x32')];}get[_0x16b7('0x28')](){const _0x56e17b=this['name'][_0x16b7('0x30')]('\x20');return 0x1===_0x56e17b[_0x16b7('0x2f')]?this['_getInitial'](_0x56e17b[0x0]):this[_0x16b7('0x15')](_0x56e17b[0x0])+this[_0x16b7('0x15')](_0x56e17b[_0x56e17b['length']-0x1]);}[_0x16b7('0x15')](_0x35a095){return _0x35a095[_0x16b7('0x29')](0x0)[_0x16b7('0x38')]();}}function a(_0x5d73ef,_0x1dbd58=''){return''==(_0x1dbd58=_0x1dbd58[_0x16b7('0x34')]())?_0x279fea(_0x5d73ef,_0x16b7('0xa')):_0x1dbd58;}class u{constructor(_0x5d6a78){this[_0x16b7('0x2b')]=_0x5d6a78;}['getBackgroundColorClass'](){return _0x16b7('0x1d')+this['_id'];}['getSelectionClass'](){return _0x16b7('0x20')+this[_0x16b7('0x2b')];}[_0x16b7('0x31')](){return _0x16b7('0x2a')+this[_0x16b7('0x2b')];}}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
/**
|
2
|
-
* @module collaboration-core/utils/common-translations
|
3
|
-
*/
|
4
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
5
|
-
export declare function getTranslation(locale: Locale, id: string): string;
|
1
|
+
/**
|
2
|
+
* @module collaboration-core/utils/common-translations
|
3
|
+
*/
|
4
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
5
|
+
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(_0x59d4b6,_0x258714){const t=_0x59d4b6['t'];switch(_0x258714){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,16 +1,16 @@
|
|
1
|
-
/**
|
2
|
-
* @module comments/comments/ui/view/confirmmixin
|
3
|
-
*/
|
4
|
-
import type { View } from 'ckeditor5/src/ui';
|
5
|
-
import type { Locale, Mixed } from 'ckeditor5/src/utils';
|
6
|
-
/**
|
7
|
-
* Adds interface for showing confirmation view in the specific for `CommentThreadView` and `CommentView` structure
|
8
|
-
* Confirm is always set to the `content` collection at the last position.
|
9
|
-
*/
|
10
|
-
export default function ConfirmMixin<Base extends new (...args: Array<any>) => View>(base: Base): Mixed<Base, ConfirmApi>;
|
11
|
-
export interface ConfirmApi {
|
12
|
-
isConfirm: boolean;
|
13
|
-
locale: Locale;
|
14
|
-
showConfirm(message: string, element: Element): Promise<unknown>;
|
15
|
-
cancelConfirm(): void;
|
16
|
-
}
|
1
|
+
/**
|
2
|
+
* @module comments/comments/ui/view/confirmmixin
|
3
|
+
*/
|
4
|
+
import type { View } from 'ckeditor5/src/ui.js';
|
5
|
+
import type { Locale, Mixed } from 'ckeditor5/src/utils.js';
|
6
|
+
/**
|
7
|
+
* Adds interface for showing confirmation view in the specific for `CommentThreadView` and `CommentView` structure
|
8
|
+
* Confirm is always set to the `content` collection at the last position.
|
9
|
+
*/
|
10
|
+
export default function ConfirmMixin<Base extends new (...args: Array<any>) => View>(base: Base): Mixed<Base, ConfirmApi>;
|
11
|
+
export interface ConfirmApi {
|
12
|
+
isConfirm: boolean;
|
13
|
+
locale: Locale;
|
14
|
+
showConfirm(message: string, element: Element): Promise<unknown>;
|
15
|
+
cancelConfirm(): void;
|
16
|
+
}
|
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
var
|
23
|
+
var _0x1d09=['focus','cancel','render','once','element','confirmView','deregisterChild','_removeConfirm','cancelConfirm','message','submit','isConfirm','appendChild','locale'];(function(_0x34d63b,_0x1d0994){var _0x31aee4=function(_0x227a1c){while(--_0x227a1c){_0x34d63b['push'](_0x34d63b['shift']());}};_0x31aee4(++_0x1d0994);}(_0x1d09,0x142));var _0x31ae=function(_0x34d63b,_0x1d0994){_0x34d63b=_0x34d63b-0x0;var _0x31aee4=_0x1d09[_0x34d63b];return _0x31aee4;};import _0x4f8571 from'./confirmview.js';export default function m(_0x40260b){return class extends _0x40260b{['showConfirm'](_0x5d9ece,_0x19683e){return this[_0x31ae('0x5')]=new _0x4f8571(this[_0x31ae('0xd')]),this[_0x31ae('0x5')][_0x31ae('0x2')](),this[_0x31ae('0x5')][_0x31ae('0x9')]=_0x5d9ece,this[_0x31ae('0x5')][_0x31ae('0x3')](_0x31ae('0x1'),()=>{this[_0x31ae('0x7')]();}),this[_0x31ae('0x5')][_0x31ae('0x3')](_0x31ae('0xa'),()=>{this[_0x31ae('0x7')]();}),_0x19683e[_0x31ae('0xc')](this[_0x31ae('0x5')]['element']),this['registerChild'](this[_0x31ae('0x5')]),this['element'][_0x31ae('0x0')](),this['set'](_0x31ae('0xb'),!0x0),new Promise(_0x37981d=>this[_0x31ae('0x5')]['on']('submit',_0x37981d));}[_0x31ae('0x8')](){this['isConfirm']&&this['confirmView']['fire'](_0x31ae('0x1'));}[_0x31ae('0x7')](){this[_0x31ae('0x4')]&&this[_0x31ae('0x5')]&&this[_0x31ae('0x5')][_0x31ae('0x4')]&&(this[_0x31ae('0x4')][_0x31ae('0x0')](),this['confirmView'][_0x31ae('0x4')]['remove'](),this[_0x31ae('0x6')](this[_0x31ae('0x5')]),this[_0x31ae('0xb')]=!0x1,this['confirmView']['destroy'](),this['confirmView']=void 0x0);}};}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
/**
|
2
|
-
* @module comments/comments/ui/view/confirmview
|
3
|
-
*/
|
4
|
-
import { View } from 'ckeditor5/src/ui';
|
5
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
6
|
-
export default class ConfirmView extends View {
|
7
|
-
message: string;
|
8
|
-
constructor(locale: Locale);
|
9
|
-
}
|
1
|
+
/**
|
2
|
+
* @module comments/comments/ui/view/confirmview
|
3
|
+
*/
|
4
|
+
import { View } from 'ckeditor5/src/ui.js';
|
5
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
6
|
+
export default class ConfirmView extends View {
|
7
|
+
message: string;
|
8
|
+
constructor(locale: Locale);
|
9
|
+
}
|
package/src/utils/confirmview.js
CHANGED
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
const
|
23
|
+
const _0x21f4=['cancelView','submit','icon','extendTemplate','submitView','fire','cancel','div','ck-thread__remove-confirm-actions','label','bindTemplate','execute','message','ck-thread__remove-confirm-inner','ck-thread__remove-confirm','Yes','set','_createButtonView'];(function(_0x2b0898,_0x21f404){const _0xb36e8=function(_0xc44b26){while(--_0xc44b26){_0x2b0898['push'](_0x2b0898['shift']());}};_0xb36e8(++_0x21f404);}(_0x21f4,0x118));const _0xb36e=function(_0x2b0898,_0x21f404){_0x2b0898=_0x2b0898-0x0;let _0xb36e8=_0x21f4[_0x2b0898];return _0xb36e8;};import{View as _0x596d33,ButtonView as _0x57f120}from'ckeditor5/src/ui.js';import{icons as _0x6727b9}from'ckeditor5/src/core.js';import{getTranslation as _0x4b00e8}from'./common-translations.js';export default class h extends _0x596d33{constructor(_0x4ed6dc){super(_0x4ed6dc);const _0x40f599=this[_0xb36e('0x0')];this[_0xb36e('0xc')]=this[_0xb36e('0x7')](_0x4ed6dc,_0x4b00e8(_0x4ed6dc,_0xb36e('0x5')),_0x6727b9['check'],_0xb36e('0x9')),this['cancelView']=this[_0xb36e('0x7')](_0x4ed6dc,_0x4b00e8(_0x4ed6dc,'No'),_0x6727b9[_0xb36e('0xe')],'cancel'),this[_0xb36e('0x6')](_0xb36e('0x2'),_0x4b00e8(_0x4ed6dc,'Are\x20you\x20sure?')),this['setTemplate']({'tag':'div','attributes':{'class':[_0xb36e('0x4')]},'children':[{'tag':'div','attributes':{'class':_0xb36e('0x3')},'children':[{'tag':'p','children':[{'text':_0x40f599['to'](_0xb36e('0x2'))}]},{'tag':_0xb36e('0xf'),'attributes':{'class':_0xb36e('0x10')},'children':[this[_0xb36e('0xc')],this[_0xb36e('0x8')]]}]}]});}[_0xb36e('0x7')](_0x4cb96d,_0x5dc2cb,_0x4436e2,_0xb903be){const _0x174df0=new _0x57f120(_0x4cb96d);return _0x174df0[_0xb36e('0x11')]=_0x5dc2cb,_0x174df0[_0xb36e('0xa')]=_0x4436e2,_0x174df0[_0xb36e('0xb')]({'attributes':{'class':'ck-thread__remove-confirm-'+_0xb903be}}),_0x174df0['on'](_0xb36e('0x1'),()=>this[_0xb36e('0xd')](_0xb903be)),_0x174df0;}}
|
@@ -1,29 +1,29 @@
|
|
1
|
-
/**
|
2
|
-
* @module collaboration-core/utils/getdatetimeformatter
|
3
|
-
* @publicApi
|
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
|
+
* @module collaboration-core/utils/getdatetimeformatter
|
3
|
+
* @publicApi
|
4
|
+
*/
|
5
|
+
import type { LocaleConfig } from '../config.js';
|
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/esm/format/index.js'
|
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 _0x4a9f=['\x27Today\x27\x20hh:mma','dateTimeFormat','\x27Last\x27\x20EEEE\x20hh:mma','\x27Yesterday\x27\x20hh:mma','MM-dd-yyyy\x20hh:mma','string'];(function(_0x57cbf1,_0x4a9fc5){const _0x41c590=function(_0x4bcb97){while(--_0x4bcb97){_0x57cbf1['push'](_0x57cbf1['shift']());}};_0x41c590(++_0x4a9fc5);}(_0x4a9f,0x1d5));const _0x41c5=function(_0x57cbf1,_0x4a9fc5){_0x57cbf1=_0x57cbf1-0x0;let _0x41c590=_0x4a9f[_0x57cbf1];return _0x41c590;};import _0x36ab5a from'date-fns/esm/format/index.js';import _0x2ce2cb from'date-fns/parseISO/index.js';import _0x443fe4 from'date-fns/differenceInCalendarDays/index.js';import{CKEditorError as _0x327c0c}from'ckeditor5/src/utils.js';export default function j(_0x5ab87d={}){if(void 0x0!==_0x5ab87d[_0x41c5('0x0')]&&'function'!=typeof _0x5ab87d[_0x41c5('0x0')])throw new _0x327c0c('invalid-date-time-format');return _0x352956=>{const _0xa2b60=_0x41c5('0x4')==typeof _0x352956?_0x2ce2cb(_0x352956):_0x352956,_0x1cbd37=new Date(),_0x5c3425=_0x443fe4(_0x1cbd37,_0xa2b60);return _0x5ab87d[_0x41c5('0x0')]?_0x5ab87d[_0x41c5('0x0')](_0xa2b60):_0x36ab5a(_0xa2b60,0x0===_0x5c3425?_0x41c5('0x5'):0x1===_0x5c3425?_0x41c5('0x2'):_0x5c3425<0x7?_0x41c5('0x1'):_0x41c5('0x3'));};}
|
@@ -1,21 +1,21 @@
|
|
1
|
-
/**
|
2
|
-
* @module comments/utils/getmarkerdomelement
|
3
|
-
*/
|
4
|
-
import type { EditingController, Marker } from 'ckeditor5/src/engine';
|
5
|
-
/**
|
6
|
-
* Returns a first DOM element mapped with the marker.
|
7
|
-
*
|
8
|
-
* @param editing Editing controller instance.
|
9
|
-
* @param marker Marker instance.
|
10
|
-
*/
|
11
|
-
export default function getMarkerDomElement(editing: EditingController, marker: Marker): HTMLElement | null;
|
12
|
-
/**
|
13
|
-
* Returns all DOM elements mapped with all given markers. DOM elements are sorted by their client rects in top-most, left-most order.
|
14
|
-
* Returns `null` if `markers` is empty or there are no DOM elements bound with the markers.
|
15
|
-
*
|
16
|
-
* Note, that markers should not intersect.
|
17
|
-
*
|
18
|
-
* @param editing Editing controller instance.
|
19
|
-
* @param markers Markers instances.
|
20
|
-
*/
|
21
|
-
export declare function getAllMarkersDomElementsSorted(editing: EditingController, markers: Array<Marker>): Array<HTMLElement> | null;
|
1
|
+
/**
|
2
|
+
* @module comments/utils/getmarkerdomelement
|
3
|
+
*/
|
4
|
+
import type { EditingController, Marker } from 'ckeditor5/src/engine.js';
|
5
|
+
/**
|
6
|
+
* Returns a first DOM element mapped with the marker.
|
7
|
+
*
|
8
|
+
* @param editing Editing controller instance.
|
9
|
+
* @param marker Marker instance.
|
10
|
+
*/
|
11
|
+
export default function getMarkerDomElement(editing: EditingController, marker: Marker): HTMLElement | null;
|
12
|
+
/**
|
13
|
+
* Returns all DOM elements mapped with all given markers. DOM elements are sorted by their client rects in top-most, left-most order.
|
14
|
+
* Returns `null` if `markers` is empty or there are no DOM elements bound with the markers.
|
15
|
+
*
|
16
|
+
* Note, that markers should not intersect.
|
17
|
+
*
|
18
|
+
* @param editing Editing controller instance.
|
19
|
+
* @param markers Markers instances.
|
20
|
+
*/
|
21
|
+
export declare function getAllMarkersDomElementsSorted(editing: EditingController, markers: Array<Marker>): Array<HTMLElement> | null;
|
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
const
|
23
|
+
const _0xb815=['values','push','getClientRects','name','domConverter','sort','map','mapViewToDom','mapper','item','from','filter','length','domElement','markerNameToElements','view'];(function(_0x47d709,_0xb81589){const _0x44ee92=function(_0x526ef5){while(--_0x526ef5){_0x47d709['push'](_0x47d709['shift']());}};_0x44ee92(++_0xb81589);}(_0xb815,0x192));const _0x44ee=function(_0x47d709,_0xb81589){_0x47d709=_0x47d709-0x0;let _0x44ee92=_0xb815[_0x47d709];return _0x44ee92;};import{first as _0x370441}from'ckeditor5/src/utils.js';export default function k(_0x434070,_0x48ae3e){const _0x226ba5=_0x434070[_0x44ee('0x6')][_0x44ee('0xc')](_0x48ae3e[_0x44ee('0x1')]);if(!_0x226ba5)return null;const _0x59e682=_0x370441(_0x226ba5[_0x44ee('0xe')]());return _0x434070['view'][_0x44ee('0x2')][_0x44ee('0x5')](_0x59e682)||null;}export function getAllMarkersDomElementsSorted(_0x49dc95,_0x198842){if(0x0===_0x198842[_0x44ee('0xa')])return null;const _0x280ea8=[],_0x515cec=_0x49dc95[_0x44ee('0xd')][_0x44ee('0x2')];for(const _0x1c59c4 of _0x198842){const _0x32443d=_0x49dc95['mapper'][_0x44ee('0xc')](_0x1c59c4[_0x44ee('0x1')]);if(!_0x32443d)continue;const _0xb2fadb=Array[_0x44ee('0x8')](_0x32443d)[_0x44ee('0x4')](_0x476433=>_0x515cec[_0x44ee('0x5')](_0x476433))[_0x44ee('0x9')](_0x303e44=>!!_0x303e44);_0x280ea8[_0x44ee('0xf')](..._0xb2fadb);}if(0x0===_0x280ea8[_0x44ee('0xa')])return null;const _0x40d310=[];for(const _0x5e5c0e of _0x280ea8){const _0x6a4f20=_0x5e5c0e[_0x44ee('0x0')]()[_0x44ee('0x7')](0x0);_0x6a4f20&&_0x40d310[_0x44ee('0xf')]({'x':_0x6a4f20['x'],'y':_0x6a4f20['y'],'domElement':_0x5e5c0e});}return 0x0===_0x40d310[_0x44ee('0xa')]?null:(_0x40d310[_0x44ee('0x3')]((_0x702cd,_0x32b432)=>_0x702cd['y']-_0x32b432['y']||_0x702cd['x']-_0x32b432['x']),_0x40d310[_0x44ee('0x4')](_0x14d07a=>_0x14d07a[_0x44ee('0xb')]));}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/**
|
2
|
-
* @module track-changes/utils/hashobject
|
3
|
-
*/
|
4
|
-
export default function hashObject(obj: Record<string, unknown>): string;
|
1
|
+
/**
|
2
|
+
* @module track-changes/utils/hashobject
|
3
|
+
*/
|
4
|
+
export default function hashObject(obj: Record<string, unknown>): string;
|