@ckeditor/ckeditor5-collaboration-core 30.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": "30.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": "^30.0.0"
30
+ "ckeditor5": "^31.0.0"
31
31
  }
32
32
  }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xc108=['addCommentThread','pluginName','has','config','editors','noPermissions','setAdminPermissions','isReadOnly','Permissions','document:write','comment:write','context','get','collaboration.channelId','permissions-set-permissions-invalid-channel-id','switchReadOnly','forceDisabled','commands','clearForceDisabled','CommentsOnly','find','CommentsRepository','plugins','setPermissions','includes'];(function(_0x54c739,_0xc10852){const _0x3bfbf7=function(_0x53364b){while(--_0x53364b){_0x54c739['push'](_0x54c739['shift']());}};_0x3bfbf7(++_0xc10852);}(_0xc108,0x1c8));const _0x3bfb=function(_0x54c739,_0xc10852){_0x54c739=_0x54c739-0x0;let _0x3bfbf7=_0xc108[_0x54c739];return _0x3bfbf7;};import{ContextPlugin as _0x12e525,Editor as _0x1f6b2d}from'ckeditor5/src/core';import{CKEditorError as _0x13b28c}from'ckeditor5/src/utils';export default class e extends _0x12e525{static get[_0x3bfb('0x14')](){return _0x3bfb('0x2');}[_0x3bfb('0x11')](_0x58153f,_0xaf96d0){let _0x21b8d5;if(_0xaf96d0||(_0xaf96d0=this[_0x3bfb('0x5')][_0x3bfb('0x16')][_0x3bfb('0x6')](_0x3bfb('0x7'))),this[_0x3bfb('0x5')][_0x3bfb('0x16')]['get'](_0x3bfb('0x7'))==_0xaf96d0?_0x21b8d5=this['context']:this[_0x3bfb('0x5')]['editors']&&(_0x21b8d5=this[_0x3bfb('0x5')][_0x3bfb('0x17')][_0x3bfb('0xe')](_0x51b38b=>_0x51b38b[_0x3bfb('0x16')]['get'](_0x3bfb('0x7'))==_0xaf96d0)),!_0x21b8d5)throw new _0x13b28c(_0x3bfb('0x8'),null);const _0x10471a=_0x21b8d5[_0x3bfb('0x10')],_0x4e7b06=_0x21b8d5 instanceof _0x1f6b2d,_0x1a3fe6=_0x10471a[_0x3bfb('0x15')](_0x3bfb('0xf'))&&_0x10471a['get']('CommentsRepository'),_0x2ee62f=_0x10471a[_0x3bfb('0x15')](_0x3bfb('0xd'))&&_0x10471a[_0x3bfb('0x6')](_0x3bfb('0xd')),_0x431e26=_0x58153f[_0x3bfb('0x12')](_0x3bfb('0x3')),_0x4eb34a=_0x58153f[_0x3bfb('0x12')]('comment:admin'),_0x1cbd3b=_0x58153f[_0x3bfb('0x12')](_0x3bfb('0x4'))||_0x4eb34a;if(_0x2ee62f&&(_0x2ee62f['isEnabled']=!_0x431e26&&_0x1cbd3b),_0x4e7b06&&(_0x21b8d5[_0x3bfb('0x1')]=!(_0x431e26||_0x1cbd3b&&_0x1a3fe6)),_0x1a3fe6){_0x1a3fe6[_0x3bfb('0x9')](!_0x1cbd3b,_0xaf96d0),_0x1a3fe6[_0x3bfb('0x0')](_0x4eb34a,_0xaf96d0);const _0x3c6eb0=_0x4e7b06&&_0x21b8d5[_0x3bfb('0xb')]['get'](_0x3bfb('0x13'));_0x3c6eb0&&(_0x1cbd3b?_0x3c6eb0[_0x3bfb('0xc')](_0x3bfb('0x18')):_0x3c6eb0[_0x3bfb('0xa')]('noPermissions'));}}}
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 _0x1450=['ck-user','ck-user__avatar','push','setTemplate','avatar','div','name','ck-user__img','initials','ck-user__anonymous','url(\x27','isAnonymous'];(function(_0x376ed2,_0x1450da){const _0x28962f=function(_0xa2f065){while(--_0xa2f065){_0x376ed2['push'](_0x376ed2['shift']());}};_0x28962f(++_0x1450da);}(_0x1450,0x14d));const _0x2896=function(_0x376ed2,_0x1450da){_0x376ed2=_0x376ed2-0x0;let _0x28962f=_0x1450[_0x376ed2];return _0x28962f;};import{View as _0x108c4d}from'ckeditor5/src/ui';import'../../../theme/users.css';export default class a extends _0x108c4d{constructor(_0x4aa71d,_0x5ab901){super(_0x4aa71d),this['name']=_0x5ab901[_0x2896('0x9')];const _0x43569a=['ck',_0x2896('0xa')];_0x5ab901[_0x2896('0x2')]&&_0x43569a['push'](_0x2896('0x0')),_0x5ab901[_0x2896('0x7')]&&_0x43569a[_0x2896('0x5')](_0x2896('0x4')),this[_0x2896('0x6')]({'tag':_0x2896('0x8'),'attributes':{'class':['ck',_0x2896('0x3')],'data-user-id':_0x5ab901['id']},'children':[{'tag':_0x2896('0x8'),'attributes':{'class':_0x43569a,'style':{'background-image':_0x5ab901[_0x2896('0x7')]?_0x2896('0x1')+_0x5ab901[_0x2896('0x7')]+'\x27)':''}}},{'tag':'div','attributes':{'class':_0x5ab901[_0x2896('0x7')]?'ck\x20ck-user__name\x20ck-user__name--hidden':'ck\x20ck-user__name'},'children':[{'text':_0x5ab901[_0x2896('0xb')]}]}]});}}
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 _0x31719e}from'ckeditor5/src/core';import{Collection as _0x5a912d,CKEditorError as _0x595cc1}from'ckeditor5/src/utils';import _0x1707c7 from'./permissions';import'../theme/usercolors.css';export default class r extends _0x31719e{static get['pluginName'](){return'Users';}static get['requires'](){return[_0x1707c7];}constructor(_0x252368){super(_0x252368),_0x252368['config']['define']('users.anonymousUserId','anonymous-user'),_0x252368['config']['define']('users.colorsCount',0x8),this['users']=new _0x5a912d(),this['_locale']=_0x252368['locale'],this['_licenseKeyCheckInterval']=null,this['_lastColor']=0x0,this['_myId']=null,this['decorate']('getOperationAuthor');}['init'](){const _0x3e7da5=this['context'];this['licenseKey']=_0x3e7da5['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1a8697;for(const _0x236f04 in _0x3e7da5){const _0x204ec1=_0x3e7da5[_0x236f04];if('licenseKeyTrial'===_0x204ec1||'licenseKeyInvalid'===_0x204ec1||'licenseKeyValid'===_0x204ec1||'licenseKeyTrialLimit'==_0x204ec1){delete _0x3e7da5[_0x236f04],_0x1a8697=_0x204ec1;break;}}if('licenseKeyInvalid'===_0x1a8697)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x595cc1('invalid-license-key',null);if('licenseKeyTrial'===_0x1a8697&&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'===_0x1a8697)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x595cc1('trial-license-key-reached-limit',null);'licenseKeyValid'===_0x1a8697&&clearInterval(this['_licenseKeyCheckInterval']);},0x3e8);}get['me'](){return null==this['_myId']?null:this['getUser'](this['_myId']);}['addUser'](_0x585a11){if(!(_0x585a11=Object['assign']({},_0x585a11,{'color':this['_getNextColor']()}))['id']||'string'!=typeof _0x585a11['id'])throw new _0x595cc1('users-add-invalid-id');if(this['users']['has'](_0x585a11['id']))throw new _0x595cc1('users-add-duplicated-id',null,{'id':_0x585a11['id']});_0x585a11['name']=function(_0x130457,_0x40b2c2=''){const {t:t}=_0x130457;return''==(_0x40b2c2=_0x40b2c2['trim']())?t('Anonymous'):_0x40b2c2;}(this['_locale'],_0x585a11['name']);const _0x40c4cd=new l(_0x585a11);return this['users']['add'](_0x40c4cd),_0x40c4cd;}['getUser'](_0x4217b){return this['users']['get'](_0x4217b);}['useAnonymousUser'](){const _0x547454=this['context']['config']['get']('users.anonymousUserId'),{t:t}=this['_locale'];if(this['users']['has'](_0x547454))return;this['addUser']({'id':_0x547454,'name':t('Anonymous')})['_isAnonymous']=!0x0,this['defineMe'](_0x547454);}['defineMe'](_0x4c93b3){if(this['_myId'])throw new _0x595cc1('users-me-already-defined',null);if(!this['getUser'](_0x4c93b3))throw new _0x595cc1('users-me-missing-user',null);this['_myId']=_0x4c93b3;}['getOperationAuthor'](){return this['me'];}['destroy'](){super['destroy'](),clearInterval(this['_licenseKeyCheckInterval']);}['_getNextColor'](){const _0x49ffa0=this['context']['config']['get']('users.colorsCount');return this['_lastColor']>=_0x49ffa0&&(this['_lastColor']=0x0),new u(this['_lastColor']++);}}class l{constructor(_0x70c972){this['id']=_0x70c972['id'],this['color']=_0x70c972['color'],this['name']=_0x70c972['name'],this['avatar']=_0x70c972['avatar'],this['_isAnonymous']=!0x1;}get['isAnonymous'](){return this['_isAnonymous'];}get['initials'](){const _0x220a01=this['name']['split']('\x20');return 0x1===_0x220a01['length']?this['_getInitial'](_0x220a01[0x0]):this['_getInitial'](_0x220a01[0x0])+this['_getInitial'](_0x220a01[_0x220a01['length']-0x1]);}['_getInitial'](_0x108e3d){return _0x108e3d['charAt'](0x0)['toUpperCase']();}}class u{constructor(_0x2b84dd){this['_id']=_0x2b84dd;}['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'];}}