@ckeditor/ckeditor5-collaboration-core 29.0.0 → 31.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-collaboration-core",
3
- "version": "29.0.0",
3
+ "version": "31.0.0",
4
4
  "description": "Base utilities used by CKEditor 5 collaboration features to support multiple users working together in a rich text editor.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -27,6 +27,6 @@
27
27
  "framework"
28
28
  ],
29
29
  "dependencies": {
30
- "ckeditor5": "^29.0.0"
30
+ "ckeditor5": "^31.0.0"
31
31
  }
32
32
  }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4f3e=['CommentsRepository','clearForceDisabled','get','isEnabled','switchReadOnly','config','context','isReadOnly','CommentsOnly','commands','comment:admin','pluginName','has','find','forceDisabled','setAdminPermissions','addCommentThread','editors','collaboration.channelId','plugins','Permissions','comment:write','setPermissions','includes','document:write','noPermissions'];(function(_0x3bc598,_0x4f3e68){const _0x5ff9fd=function(_0x309609){while(--_0x309609){_0x3bc598['push'](_0x3bc598['shift']());}};_0x5ff9fd(++_0x4f3e68);}(_0x4f3e,0x15f));const _0x5ff9=function(_0x3bc598,_0x4f3e68){_0x3bc598=_0x3bc598-0x0;let _0x5ff9fd=_0x4f3e[_0x3bc598];return _0x5ff9fd;};import{ContextPlugin as _0x1a6e0a,Editor as _0x12547e}from'ckeditor5/src/core';import{CKEditorError as _0xde2fb7}from'ckeditor5/src/utils';export default class e extends _0x1a6e0a{static get[_0x5ff9('0x18')](){return _0x5ff9('0x7');}[_0x5ff9('0x9')](_0x31920b,_0x57d49a){let _0x48bc55;if(_0x57d49a||(_0x57d49a=this[_0x5ff9('0x13')][_0x5ff9('0x12')]['get'](_0x5ff9('0x5'))),this['context'][_0x5ff9('0x12')][_0x5ff9('0xf')](_0x5ff9('0x5'))==_0x57d49a?_0x48bc55=this[_0x5ff9('0x13')]:this[_0x5ff9('0x13')][_0x5ff9('0x4')]&&(_0x48bc55=this['context'][_0x5ff9('0x4')][_0x5ff9('0x0')](_0x53c5fa=>_0x53c5fa['config'][_0x5ff9('0xf')](_0x5ff9('0x5'))==_0x57d49a)),!_0x48bc55)throw new _0xde2fb7('permissions-set-permissions-invalid-channel-id',null);const _0x382cc6=_0x48bc55[_0x5ff9('0x6')],_0x5f2b95=_0x48bc55 instanceof _0x12547e,_0x452326=_0x382cc6['has']('CommentsRepository')&&_0x382cc6[_0x5ff9('0xf')](_0x5ff9('0xd')),_0x5acc85=_0x382cc6[_0x5ff9('0x19')](_0x5ff9('0x15'))&&_0x382cc6[_0x5ff9('0xf')](_0x5ff9('0x15')),_0x20109a=_0x31920b['includes'](_0x5ff9('0xb')),_0x74aac2=_0x31920b[_0x5ff9('0xa')](_0x5ff9('0x17')),_0x247b02=_0x31920b['includes'](_0x5ff9('0x8'))||_0x74aac2;if(_0x5acc85&&(_0x5acc85[_0x5ff9('0x10')]=!_0x20109a&&_0x247b02),_0x5f2b95&&(_0x48bc55[_0x5ff9('0x14')]=!(_0x20109a||_0x247b02&&_0x452326)),_0x452326){_0x452326[_0x5ff9('0x11')](!_0x247b02,_0x57d49a),_0x452326[_0x5ff9('0x2')](_0x74aac2,_0x57d49a);const _0x7beddf=_0x5f2b95&&_0x48bc55[_0x5ff9('0x16')][_0x5ff9('0xf')](_0x5ff9('0x3'));_0x7beddf&&(_0x247b02?_0x7beddf[_0x5ff9('0xe')]('noPermissions'):_0x7beddf[_0x5ff9('0x1')](_0x5ff9('0xc')));}}}
23
+ const _0x2c0b=['noPermissions','config','pluginName','comment:admin','get','comment:write','context','isReadOnly','permissions-set-permissions-invalid-channel-id','has','CommentsOnly','commands','plugins','includes','setPermissions','document:write','editors','clearForceDisabled','CommentsRepository','find','Permissions','collaboration.channelId'];(function(_0x588b2c,_0x2c0bf9){const _0x1c8c2a=function(_0x5e09ad){while(--_0x5e09ad){_0x588b2c['push'](_0x588b2c['shift']());}};_0x1c8c2a(++_0x2c0bf9);}(_0x2c0b,0x1d8));const _0x1c8c=function(_0x588b2c,_0x2c0bf9){_0x588b2c=_0x588b2c-0x0;let _0x1c8c2a=_0x2c0b[_0x588b2c];return _0x1c8c2a;};import{ContextPlugin as _0x1cc3e1,Editor as _0x40eeee}from'ckeditor5/src/core';import{CKEditorError as _0x4798b4}from'ckeditor5/src/utils';export default class e extends _0x1cc3e1{static get[_0x1c8c('0xe')](){return _0x1c8c('0xa');}[_0x1c8c('0x4')](_0x148414,_0x11f96a){let _0x83ae3f;if(_0x11f96a||(_0x11f96a=this[_0x1c8c('0x12')][_0x1c8c('0xd')][_0x1c8c('0x10')](_0x1c8c('0xb'))),this[_0x1c8c('0x12')][_0x1c8c('0xd')]['get'](_0x1c8c('0xb'))==_0x11f96a?_0x83ae3f=this[_0x1c8c('0x12')]:this[_0x1c8c('0x12')][_0x1c8c('0x6')]&&(_0x83ae3f=this[_0x1c8c('0x12')][_0x1c8c('0x6')][_0x1c8c('0x9')](_0x356cca=>_0x356cca['config'][_0x1c8c('0x10')](_0x1c8c('0xb'))==_0x11f96a)),!_0x83ae3f)throw new _0x4798b4(_0x1c8c('0x14'),null);const _0x528a2e=_0x83ae3f[_0x1c8c('0x2')],_0x36dd39=_0x83ae3f instanceof _0x40eeee,_0x2ade43=_0x528a2e[_0x1c8c('0x15')](_0x1c8c('0x8'))&&_0x528a2e[_0x1c8c('0x10')](_0x1c8c('0x8')),_0x1f8104=_0x528a2e['has'](_0x1c8c('0x0'))&&_0x528a2e[_0x1c8c('0x10')](_0x1c8c('0x0')),_0x232102=_0x148414[_0x1c8c('0x3')](_0x1c8c('0x5')),_0x18883f=_0x148414[_0x1c8c('0x3')](_0x1c8c('0xf')),_0xede0a7=_0x148414[_0x1c8c('0x3')](_0x1c8c('0x11'))||_0x18883f;if(_0x1f8104&&(_0x1f8104['isEnabled']=!_0x232102&&_0xede0a7),_0x36dd39&&(_0x83ae3f[_0x1c8c('0x13')]=!(_0x232102||_0xede0a7&&_0x2ade43)),_0x2ade43){_0x2ade43['switchReadOnly'](!_0xede0a7,_0x11f96a),_0x2ade43['setAdminPermissions'](_0x18883f,_0x11f96a);const _0x3c9301=_0x36dd39&&_0x83ae3f[_0x1c8c('0x1')][_0x1c8c('0x10')]('addCommentThread');_0x3c9301&&(_0xede0a7?_0x3c9301[_0x1c8c('0x7')](_0x1c8c('0xc')):_0x3c9301['forceDisabled']('noPermissions'));}}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x3947=['ck-user','push','div','initials','name','ck-user__avatar','ck\x20ck-user__name','avatar'];(function(_0xb7cd88,_0x394783){const _0x27ae07=function(_0x15b2c6){while(--_0x15b2c6){_0xb7cd88['push'](_0xb7cd88['shift']());}};_0x27ae07(++_0x394783);}(_0x3947,0x94));const _0x27ae=function(_0xb7cd88,_0x394783){_0xb7cd88=_0xb7cd88-0x0;let _0x27ae07=_0x3947[_0xb7cd88];return _0x27ae07;};import{View as _0x515da0}from'ckeditor5/src/ui';import'../../../theme/users.css';export default class a extends _0x515da0{constructor(_0x37aa57,_0x49cbe9){super(_0x37aa57),this[_0x27ae('0x0')]=_0x49cbe9[_0x27ae('0x0')];const _0x1f45d1=['ck','ck-user__img'];_0x49cbe9['isAnonymous']&&_0x1f45d1[_0x27ae('0x5')]('ck-user__anonymous'),_0x49cbe9[_0x27ae('0x3')]&&_0x1f45d1[_0x27ae('0x5')](_0x27ae('0x1')),this['setTemplate']({'tag':_0x27ae('0x6'),'attributes':{'class':['ck',_0x27ae('0x4')],'data-user-id':_0x49cbe9['id']},'children':[{'tag':_0x27ae('0x6'),'attributes':{'class':_0x1f45d1,'style':{'background-image':_0x49cbe9['avatar']?'url(\x27'+_0x49cbe9[_0x27ae('0x3')]+'\x27)':''}}},{'tag':_0x27ae('0x6'),'attributes':{'class':_0x49cbe9[_0x27ae('0x3')]?'ck\x20ck-user__name\x20ck-user__name--hidden':_0x27ae('0x2')},'children':[{'text':_0x49cbe9[_0x27ae('0x7')]}]}]});}}
23
+ const _0x334a=['ck-user','div','isAnonymous','avatar','ck-user__avatar','name','url(\x27','setTemplate','push'];(function(_0x59d92d,_0x334aad){const _0xdf6b3b=function(_0x5b9afb){while(--_0x5b9afb){_0x59d92d['push'](_0x59d92d['shift']());}};_0xdf6b3b(++_0x334aad);}(_0x334a,0x1dd));const _0xdf6b=function(_0x59d92d,_0x334aad){_0x59d92d=_0x59d92d-0x0;let _0xdf6b3b=_0x334a[_0x59d92d];return _0xdf6b3b;};import{View as _0x106807}from'ckeditor5/src/ui';import'../../../theme/users.css';export default class a extends _0x106807{constructor(_0x5c3815,_0xaf52c5){super(_0x5c3815),this[_0xdf6b('0x5')]=_0xaf52c5['name'];const _0x231e99=['ck','ck-user__img'];_0xaf52c5[_0xdf6b('0x2')]&&_0x231e99[_0xdf6b('0x8')]('ck-user__anonymous'),_0xaf52c5[_0xdf6b('0x3')]&&_0x231e99['push'](_0xdf6b('0x4')),this[_0xdf6b('0x7')]({'tag':_0xdf6b('0x1'),'attributes':{'class':['ck',_0xdf6b('0x0')],'data-user-id':_0xaf52c5['id']},'children':[{'tag':_0xdf6b('0x1'),'attributes':{'class':_0x231e99,'style':{'background-image':_0xaf52c5[_0xdf6b('0x3')]?_0xdf6b('0x6')+_0xaf52c5['avatar']+'\x27)':''}}},{'tag':_0xdf6b('0x1'),'attributes':{'class':_0xaf52c5[_0xdf6b('0x3')]?'ck\x20ck-user__name\x20ck-user__name--hidden':'ck\x20ck-user__name'},'children':[{'text':_0xaf52c5['initials']}]}]});}}
package/src/users.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x1d3383}from'ckeditor5/src/core';import{Collection as _0x42a1b8,CKEditorError as _0x8b37c1}from'ckeditor5/src/utils';import _0x416f03 from'./permissions';import'../theme/usercolors.css';export default class r extends _0x1d3383{static get['pluginName'](){return'Users';}static get['requires'](){return[_0x416f03];}constructor(_0x43b921){super(_0x43b921),_0x43b921['config']['define']('users.anonymousUserId','anonymous-user'),_0x43b921['config']['define']('users.colorsCount',0x8),this['users']=new _0x42a1b8(),this['_locale']=_0x43b921['locale'],this['_licenseKeyCheckInterval']=null,this['_lastColor']=0x0,this['_myId']=null,this['decorate']('getOperationAuthor');}['init'](){const _0x2d1fc7=this['context'];this['licenseKey']=_0x2d1fc7['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4af13c;for(const _0x5bc2cc in _0x2d1fc7){const _0x37e643=_0x2d1fc7[_0x5bc2cc];if('licenseKeyTrial'===_0x37e643||'licenseKeyInvalid'===_0x37e643||'licenseKeyValid'===_0x37e643||'licenseKeyTrialLimit'==_0x37e643){delete _0x2d1fc7[_0x5bc2cc],_0x4af13c=_0x37e643;break;}}if('licenseKeyInvalid'===_0x4af13c)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x8b37c1('invalid-license-key',null);if('licenseKeyTrial'===_0x4af13c&&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'===_0x4af13c)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x8b37c1('trial-license-key-reached-limit',null);'licenseKeyValid'===_0x4af13c&&clearInterval(this['_licenseKeyCheckInterval']);},0x3e8);}get['me'](){return null==this['_myId']?null:this['getUser'](this['_myId']);}['addUser'](_0x565aca){if(!(_0x565aca=Object['assign']({},_0x565aca,{'color':this['_getNextColor']()}))['id']||'string'!=typeof _0x565aca['id'])throw new _0x8b37c1('users-add-invalid-id');if(this['users']['has'](_0x565aca['id']))throw new _0x8b37c1('users-add-duplicated-id',null,{'id':_0x565aca['id']});_0x565aca['name']=function(_0x399d05,_0x315d53=''){const {t:t}=_0x399d05;return''==(_0x315d53=_0x315d53['trim']())?t('Anonymous'):_0x315d53;}(this['_locale'],_0x565aca['name']);const _0xdadc55=new l(_0x565aca);return this['users']['add'](_0xdadc55),_0xdadc55;}['getUser'](_0x147b1a){return this['users']['get'](_0x147b1a);}['useAnonymousUser'](){const _0x1e0553=this['context']['config']['get']('users.anonymousUserId'),{t:t}=this['_locale'];if(this['users']['has'](_0x1e0553))return;this['addUser']({'id':_0x1e0553,'name':t('Anonymous')})['_isAnonymous']=!0x0,this['defineMe'](_0x1e0553);}['defineMe'](_0x167964){if(this['_myId'])throw new _0x8b37c1('users-me-already-defined',null);if(!this['getUser'](_0x167964))throw new _0x8b37c1('users-me-missing-user',null);this['_myId']=_0x167964;}['getOperationAuthor'](){return this['me'];}['destroy'](){super['destroy'](),clearInterval(this['_licenseKeyCheckInterval']);}['_getNextColor'](){const _0xf33c29=this['context']['config']['get']('users.colorsCount');return this['_lastColor']>=_0xf33c29&&(this['_lastColor']=0x0),new u(this['_lastColor']++);}}class l{constructor(_0xbe6241){this['id']=_0xbe6241['id'],this['color']=_0xbe6241['color'],this['name']=_0xbe6241['name'],this['avatar']=_0xbe6241['avatar'],this['_isAnonymous']=!0x1;}get['isAnonymous'](){return this['_isAnonymous'];}get['initials'](){return this['name']['split']('\x20')['map'](_0x51ceef=>_0x51ceef['charAt'](0x0))['slice'](0x0,0x2)['join']('')['toUpperCase']();}}class u{constructor(_0xdce4c7){this['_id']=_0xdce4c7;}['getBackgroundColorClass'](){return'ck-user__bg-color--'+this['_id'];}['getSelectionClass'](){return'ck-user__selection--'+this['_id'];}['getMarkerClass'](){return'ck-user__marker--'+this['_id'];}}
23
+ import{ContextPlugin as _0x1c3534}from'ckeditor5/src/core';import{Collection as _0x2391e2,CKEditorError as _0x128d4e}from'ckeditor5/src/utils';import _0x2a7ca2 from'./permissions';import'../theme/usercolors.css';export default class r extends _0x1c3534{static get['pluginName'](){return'Users';}static get['requires'](){return[_0x2a7ca2];}constructor(_0x3b9171){super(_0x3b9171),_0x3b9171['config']['define']('users.anonymousUserId','anonymous-user'),_0x3b9171['config']['define']('users.colorsCount',0x8),this['users']=new _0x2391e2(),this['_locale']=_0x3b9171['locale'],this['_licenseKeyCheckInterval']=null,this['_lastColor']=0x0,this['_myId']=null,this['decorate']('getOperationAuthor');}['init'](){const _0x23bc28=this['context'];this['licenseKey']=_0x23bc28['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x594bec;for(const _0xd45a6b in _0x23bc28){const _0x26c20a=_0x23bc28[_0xd45a6b];if('licenseKeyTrial'===_0x26c20a||'licenseKeyInvalid'===_0x26c20a||'licenseKeyValid'===_0x26c20a||'licenseKeyTrialLimit'==_0x26c20a){delete _0x23bc28[_0xd45a6b],_0x594bec=_0x26c20a;break;}}if('licenseKeyInvalid'===_0x594bec)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x128d4e('invalid-license-key',null);if('licenseKeyTrial'===_0x594bec&&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'===_0x594bec)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x128d4e('trial-license-key-reached-limit',null);'licenseKeyValid'===_0x594bec&&clearInterval(this['_licenseKeyCheckInterval']);},0x3e8);}get['me'](){return null==this['_myId']?null:this['getUser'](this['_myId']);}['addUser'](_0x106f59){if(!(_0x106f59=Object['assign']({},_0x106f59,{'color':this['_getNextColor']()}))['id']||'string'!=typeof _0x106f59['id'])throw new _0x128d4e('users-add-invalid-id');if(this['users']['has'](_0x106f59['id']))throw new _0x128d4e('users-add-duplicated-id',null,{'id':_0x106f59['id']});_0x106f59['name']=function(_0x387daa,_0x728c82=''){const {t:t}=_0x387daa;return''==(_0x728c82=_0x728c82['trim']())?t('Anonymous'):_0x728c82;}(this['_locale'],_0x106f59['name']);const _0x13197d=new l(_0x106f59);return this['users']['add'](_0x13197d),_0x13197d;}['getUser'](_0x251040){return this['users']['get'](_0x251040);}['useAnonymousUser'](){const _0x24e6dd=this['context']['config']['get']('users.anonymousUserId'),{t:t}=this['_locale'];if(this['users']['has'](_0x24e6dd))return;this['addUser']({'id':_0x24e6dd,'name':t('Anonymous')})['_isAnonymous']=!0x0,this['defineMe'](_0x24e6dd);}['defineMe'](_0x1e442b){if(this['_myId'])throw new _0x128d4e('users-me-already-defined',null);if(!this['getUser'](_0x1e442b))throw new _0x128d4e('users-me-missing-user',null);this['_myId']=_0x1e442b;}['getOperationAuthor'](){return this['me'];}['destroy'](){super['destroy'](),clearInterval(this['_licenseKeyCheckInterval']);}['_getNextColor'](){const _0x242f03=this['context']['config']['get']('users.colorsCount');return this['_lastColor']>=_0x242f03&&(this['_lastColor']=0x0),new u(this['_lastColor']++);}}class l{constructor(_0x4aae5d){this['id']=_0x4aae5d['id'],this['color']=_0x4aae5d['color'],this['name']=_0x4aae5d['name'],this['avatar']=_0x4aae5d['avatar'],this['_isAnonymous']=!0x1;}get['isAnonymous'](){return this['_isAnonymous'];}get['initials'](){const _0x2f63d6=this['name']['split']('\x20');return 0x1===_0x2f63d6['length']?this['_getInitial'](_0x2f63d6[0x0]):this['_getInitial'](_0x2f63d6[0x0])+this['_getInitial'](_0x2f63d6[_0x2f63d6['length']-0x1]);}['_getInitial'](_0x4f4773){return _0x4f4773['charAt'](0x0)['toUpperCase']();}}class u{constructor(_0x2c9e9e){this['_id']=_0x2c9e9e;}['getBackgroundColorClass'](){return'ck-user__bg-color--'+this['_id'];}['getSelectionClass'](){return'ck-user__selection--'+this['_id'];}['getMarkerClass'](){return'ck-user__marker--'+this['_id'];}}