@ckeditor/ckeditor5-comments 39.0.2 → 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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/build/comments.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/lang/translations/pt-br.po +3 -3
- package/package.json +3 -3
- package/src/annotations/annotation.d.ts +90 -90
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.d.ts +98 -98
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.d.ts +154 -154
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.d.ts +232 -232
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +67 -67
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +90 -90
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +85 -85
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.d.ts +100 -100
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.d.ts +29 -29
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.d.ts +90 -90
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.d.ts +55 -55
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.d.ts +32 -32
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.d.ts +77 -77
- package/src/annotations/widesidebar.js +1 -1
- package/src/augmentation.d.ts +52 -52
- package/src/comments/addcommentthreadcommand.d.ts +35 -35
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.d.ts +31 -31
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.d.ts +38 -38
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.d.ts +79 -79
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1129 -1105
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +33 -33
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.d.ts +17 -17
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.d.ts +21 -21
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.d.ts +36 -36
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.d.ts +31 -31
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +36 -36
- package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
- package/src/comments/ui/commentthreadcontroller.d.ts +64 -64
- package/src/comments/ui/commentthreadcontroller.js +1 -1
- package/src/comments/ui/view/basecommentthreadview.d.ts +119 -112
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.d.ts +112 -112
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.d.ts +13 -13
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.d.ts +14 -14
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.d.ts +86 -86
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.d.ts +38 -38
- package/src/comments/ui/view/commentsarchiveview.js +1 -1
- package/src/comments/ui/view/commentslistview.d.ts +100 -100
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.d.ts +50 -50
- package/src/comments/ui/view/commentthreadheaderview.js +1 -1
- package/src/comments/ui/view/commentthreadinputview.d.ts +41 -41
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.d.ts +118 -117
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.d.ts +243 -243
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.d.ts +35 -35
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +33 -33
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +176 -176
- package/src/index.d.ts +24 -24
- package/src/utils/common-translations.d.ts +9 -9
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.d.ts +14 -14
- package/src/utils/createmutationobserver.js +1 -1
- package/theme/annotation-inline.css +2 -1
- package/theme/annotation.css +2 -1
- package/theme/comment.css +2 -1
- package/theme/commentinput.css +2 -1
- package/theme/commentmarker.css +2 -1
- package/theme/commentsarchive.css +2 -1
- package/theme/commentthread.css +12 -1
- package/theme/icons/add-comment.svg +1 -1
- package/theme/icons/comments-archive.svg +1 -1
- package/theme/icons/edit-comment.svg +1 -1
- package/theme/icons/remove-comment.svg +1 -1
- package/theme/sidebar-narrow.css +2 -1
- package/theme/sidebar.css +2 -1
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const _0xdbb6=['plugins','stopListening','clear','annotations','listenTo','stop','southArrowNorthWest','_selectedAnnotations','_showBalloon','create','find','element','isAttached','keydown','view','destroy','off','_attachToContainer','narrowsidebar-attach-already-attached','requires','narrowSidebar','_manuallyClosedAnnotationViews','northArrowSouthEast','refreshPositioning','_hideBalloon','_annotations','has','values','stopPropagation','EditorAnnotations','activeAnnotation','_refreshPositioning','init','hasDomSelection','_refreshPositioningDebounced','focus','change:height','delete','Esc','content','_editorAnnotations','narrowsidebar-detach-not-attached','detachFromDom','balloonPanelView','addAnnotation','mousedown','get','blur','add','set','isVisible','NarrowSidebar','defaultPositions','bind','preventDefault','contains','focusableElements','_updateBalloonPosition','_setSelectedAnnotations','register','resize','high','_attachListeners','setActiveAnnotation','from','target','detach','preventClosingBalloon','uiUpdate','low','locale','_annotationToNarrowView','refresh','southArrowNorth','_integrateWithEditorAnnotations','isDirty','_domEmitter','number','remove','esc','southArrowNorthEast','attach','_detachListeners','annotationType','cancel','context','_destroyEditorAnnotationsIntegration','length','change:container','first','bodyCollection','keyCode'];(function(_0x31adaa,_0xdbb601){const _0x4e1197=function(_0x4916ca){while(--_0x4916ca){_0x31adaa['push'](_0x31adaa['shift']());}};_0x4e1197(++_0xdbb601);}(_0xdbb6,0x134));const _0x4e11=function(_0x31adaa,_0xdbb601){_0x31adaa=_0x31adaa-0x0;let _0x4e1197=_0xdbb6[_0x31adaa];return _0x4e1197;};import{ContextPlugin as _0x4383e1,Context as _0x360811}from'ckeditor5/src/core';import _0x1d0aab from'./annotationsuis';import _0x525883 from'./sidebar';import _0x847a64 from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x35ae86,BodyCollection as _0x170d9e}from'ckeditor5/src/ui';import{CKEditorError as _0x46865d,DomEmitterMixin as _0x58cf32,keyCodes as _0x362211,Collection as _0x21be6e}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x1a3432}from'lodash-es';import _0xe0d9e5 from'./editorannotations';export default class s extends _0x4383e1{static get[_0x4e11('0x4f')](){return[_0x525883,_0x1d0aab];}static get['pluginName'](){return _0x4e11('0x13');}constructor(_0xe94f49){super(_0xe94f49),this[_0x4e11('0x48')]=!0x1,this[_0x4e11('0x51')]=new Set(),this[_0x4e11('0x2c')]=Object[_0x4e11('0x45')](_0x58cf32),this[_0x4e11('0x27')]=new Map(),this['set']('activeAnnotation',null),this[_0x4e11('0x3f')]=null,this[_0x4e11('0x43')]=[],this[_0x4e11('0x8')]=new _0x21be6e(),this[_0x4e11('0x2')]=_0x1a3432(()=>{this[_0x4e11('0x5b')]();},0xfa,{'leading':!0x1});}[_0x4e11('0x0')](){this[_0x4e11('0x35')][_0x4e11('0x3c')][_0x4e11('0xe')](_0x1d0aab)[_0x4e11('0x1b')](_0x4e11('0x50'),this),this['bodyCollection']=new _0x170d9e(this[_0x4e11('0x35')][_0x4e11('0x26')]),this[_0x4e11('0xb')]=new _0x35ae86(this[_0x4e11('0x35')][_0x4e11('0x26')]),this['bodyCollection']['attachToDom'](),this[_0x4e11('0x3a')][_0x4e11('0x10')](this[_0x4e11('0xb')]);}[_0x4e11('0x31')](_0x44be61){this[_0x4e11('0x3f')]=_0x44be61;const _0x3e3b7e=this[_0x4e11('0x35')][_0x4e11('0x3c')]['get'](_0x525883),_0x2fc2fc=this[_0x4e11('0xb')];if(_0x3e3b7e[_0x4e11('0x55')]=_0x44be61,this[_0x4e11('0x48')])throw new _0x46865d(_0x4e11('0x4e'),this);this['isAttached']=!0x0,this[_0x4e11('0x40')](_0x3e3b7e,'set:container',()=>{this[_0x4e11('0x22')](),this[_0x4e11('0x40')](_0x3e3b7e,_0x4e11('0x38'),_0x11994f=>{_0x11994f[_0x4e11('0x4c')](),this[_0x4e11('0x31')](_0x44be61);});}),_0x3e3b7e[_0x4e11('0x4d')]({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x41b600=_0x2a5262=>{const _0x76610d=new _0x847a64(this[_0x4e11('0x35')]['locale']);_0x3e3b7e[_0x4e11('0xc')](_0x2a5262,_0x76610d),this['_annotationToNarrowView'][_0x4e11('0x11')](_0x2a5262,_0x76610d),_0x76610d[_0x4e11('0x15')](_0x4e11('0x2b'),_0x4e11('0x33'),_0x4e11('0x2d'))['to'](_0x2a5262[_0x4e11('0x4a')],_0x4e11('0x2b'),'type',_0x4e11('0x37')),_0x76610d['on']('execute',()=>{this[_0x4e11('0x51')][_0x4e11('0x3e')](),_0x2fc2fc[_0x4e11('0x7')]['first']!==_0x2a5262[_0x4e11('0x4a')]?(this[_0x4e11('0x44')](_0x2a5262),_0x2a5262[_0x4e11('0x4a')][_0x4e11('0x47')]['focus'](),this[_0x4e11('0x1f')](_0x2a5262)):this[_0x4e11('0x1f')](null);});};for(const _0x54d1d1 of _0x44be61)_0x41b600(_0x54d1d1);this[_0x4e11('0x40')](_0x44be61,_0x4e11('0x10'),(_0x343598,_0x41d012)=>{_0x41b600(_0x41d012);}),this['listenTo'](_0x44be61,_0x4e11('0x2e'),(_0x48ec88,_0x3d873f,_0x76abf7)=>{this[_0x4e11('0x27')][_0x4e11('0xe')](_0x3d873f)[_0x4e11('0x4b')](),this['_annotationToNarrowView'][_0x4e11('0x5')](_0x3d873f),_0x3e3b7e['rearrange']({'removedAnnotation':_0x3d873f,'previousAnnotation':_0x44be61[_0x4e11('0xe')](_0x76abf7-0x1),'nextAnnotation':_0x44be61['get'](_0x76abf7+0x1)}),_0x3d873f===this[_0x4e11('0x5a')]&&this[_0x4e11('0x1f')](null);},{'priority':_0x4e11('0x25')}),this['listenTo'](_0x44be61,_0x4e11('0x3'),(_0x12583c,_0x56e3de)=>{this[_0x4e11('0x1f')](_0x56e3de);}),this['listenTo'](_0x44be61,_0x4e11('0xf'),()=>{this[_0x4e11('0x1f')](null);}),this['_domEmitter'][_0x4e11('0x40')](document,_0x4e11('0x49'),(_0x574d4a,_0x184c5d)=>{_0x184c5d[_0x4e11('0x3b')]===_0x362211[_0x4e11('0x2f')]&&_0x2fc2fc[_0x4e11('0x12')]&&(this[_0x4e11('0x51')][_0x4e11('0x10')](_0x2fc2fc[_0x4e11('0x7')]['first']),this[_0x4e11('0x54')](),_0x184c5d[_0x4e11('0x58')](),_0x184c5d[_0x4e11('0x16')]());}),this['_domEmitter'][_0x4e11('0x40')](document,'mousedown',(_0x45cfba,_0x28bc51)=>{const _0x5580cd=_0x28bc51['target'];_0x2fc2fc[_0x4e11('0x12')]&&_0x2fc2fc['element'][_0x4e11('0x17')](_0x5580cd)||_0x3e3b7e['view'][_0x4e11('0x47')][_0x4e11('0x17')](_0x5580cd)||_0x45cfba[_0x4e11('0x23')]||this[_0x4e11('0x5a')]&&this['activeAnnotation'][_0x4e11('0x18')][_0x4e11('0x46')](_0x3b393a=>_0x3b393a['contains'](_0x5580cd))||(this['_manuallyClosedAnnotationViews'][_0x4e11('0x3e')](),this[_0x4e11('0x54')](),this[_0x4e11('0x1f')](null));});const _0x45b12a=this['context']instanceof _0x360811?this[_0x4e11('0x35')]['editors']:new _0x21be6e([this[_0x4e11('0x35')]]);for(const _0x3d75a9 of _0x45b12a)this[_0x4e11('0x2a')](_0x3d75a9);this[_0x4e11('0x40')](_0x45b12a,_0x4e11('0x10'),(_0x523c65,_0x853599)=>{this[_0x4e11('0x40')](_0x853599,'ready',()=>{this[_0x4e11('0x2a')](_0x853599);});}),this[_0x4e11('0x40')](_0x45b12a,'remove',(_0x17804f,_0x2d8c28)=>{_0x2d8c28[_0x4e11('0x3c')][_0x4e11('0x56')](_0x4e11('0x59'))&&this['_destroyEditorAnnotationsIntegration'](_0x2d8c28['plugins'][_0x4e11('0xe')](_0x4e11('0x59')));}),window['addEventListener'](_0x4e11('0x1c'),this[_0x4e11('0x2')]),this[_0x4e11('0x5b')]();}[_0x4e11('0x1f')](_0x5131c6){if(_0x5131c6===this[_0x4e11('0x5a')])return;const _0x3907e1=this['context']['plugins']['get'](_0x525883);if(_0x3907e1[_0x4e11('0x28')]({'blurredAnnotation':this[_0x4e11('0x5a')],'activatedAnnotation':_0x5131c6,'disableAnimationOnActivatedAnnotation':!0x0}),_0x5131c6)_0x3907e1['getSidebarItemView'](_0x5131c6)?this[_0x4e11('0x44')](_0x5131c6):this[_0x4e11('0x54')]();else this[_0x4e11('0x54')]();this[_0x4e11('0x5a')]=_0x5131c6;}[_0x4e11('0x22')](){if(!this[_0x4e11('0x48')])throw new _0x46865d(_0x4e11('0x9'),this);this['setActiveAnnotation'](null);const _0x1791e7=this['context']['plugins'][_0x4e11('0xe')](_0x525883);this['_hideBalloon'](),Array[_0x4e11('0x20')](this['_annotationToNarrowView'][_0x4e11('0x57')](),_0xb8c9c3=>_0xb8c9c3[_0x4e11('0x4b')]()),this['_annotationToNarrowView'][_0x4e11('0x3e')](),_0x1791e7['_detachFromContainer'](this[_0x4e11('0x3f')]),this['stopListening'](),this[_0x4e11('0x2c')][_0x4e11('0x3d')](),this[_0x4e11('0x35')]instanceof _0x360811&&this[_0x4e11('0x3d')](this[_0x4e11('0x35')]['editors']);for(const _0x4b1920 of Array[_0x4e11('0x20')](this[_0x4e11('0x8')]))this['_destroyEditorAnnotationsIntegration'](_0x4b1920);window['removeEventListener'](_0x4e11('0x1c'),this[_0x4e11('0x2')]),this['_refreshPositioningDebounced'][_0x4e11('0x34')](),this[_0x4e11('0x43')]=[],this['isAttached']=!0x1,this['annotations']=null;}[_0x4e11('0x4b')](){this[_0x4e11('0x48')]&&this[_0x4e11('0x22')](),this[_0x4e11('0x3a')][_0x4e11('0xa')]();}['_integrateWithEditorAnnotations'](_0xe1be85){const _0x50d279=_0xe1be85[_0x4e11('0x3c')][_0x4e11('0xe')](_0xe0d9e5),_0x1ab4af=this[_0x4e11('0x35')][_0x4e11('0x3c')][_0x4e11('0xe')](_0x525883),_0x20b889=this[_0x4e11('0x3f')],_0x1e8d05=this[_0x4e11('0xb')],_0x175c91=()=>{const _0x3e1572=_0x50d279['getOrderedSelectedAnnotations']({'annotations':this[_0x4e11('0x3f')],'activeAnnotation':this['activeAnnotation']});this[_0x4e11('0x1a')](_0x3e1572),this['setActiveAnnotation'](_0x3e1572[0x0]||null);};this[_0x4e11('0x40')](_0x50d279,_0x4e11('0x28'),_0x175c91),this[_0x4e11('0x40')](_0x50d279,_0x4e11('0xf'),(_0x29faab,{isAnnotationTracked:_0x37a90c})=>{this[_0x4e11('0x5a')]&&_0x37a90c(this['activeAnnotation'])&&(this[_0x4e11('0x1a')]([]),this[_0x4e11('0x1f')](null));}),this[_0x4e11('0x40')](_0x50d279,_0x4e11('0x24'),()=>{this['_refreshPositioningDebounced']();}),this['listenTo'](_0x20b889,_0x4e11('0xf'),_0xe0d005=>{_0x50d279[_0x4e11('0x1')]()&&_0xe0d005[_0x4e11('0x41')]();},{'priority':_0x4e11('0x1d')}),this[_0x4e11('0x40')](this['_domEmitter'],_0x4e11('0xd'),(_0x336488,_0x5b280a)=>{const _0x59829f=_0x5b280a[_0x4e11('0x21')];_0x1e8d05['isVisible']&&_0x1e8d05[_0x4e11('0x47')][_0x4e11('0x17')](_0x59829f)||_0x1ab4af[_0x4e11('0x4a')][_0x4e11('0x47')][_0x4e11('0x17')](_0x59829f)||this[_0x4e11('0x5a')]&&_0x50d279[_0x4e11('0x1')]()&&(_0x175c91(),_0x336488['preventClosingBalloon']=!0x0);},{'priority':_0x4e11('0x1d')}),this[_0x4e11('0x8')][_0x4e11('0x10')](_0x50d279);}[_0x4e11('0x36')](_0x58a322){_0x58a322&&(this[_0x4e11('0x3d')](_0x58a322),this[_0x4e11('0x8')][_0x4e11('0x2e')](_0x58a322));}[_0x4e11('0x1a')](_0x4b0ed1){for(const _0x36362c of this[_0x4e11('0x43')])_0x4b0ed1['includes'](_0x36362c)||this['_manuallyClosedAnnotationViews'][_0x4e11('0x5')](_0x36362c[_0x4e11('0x4a')]);this[_0x4e11('0x43')]=_0x4b0ed1;}[_0x4e11('0x5b')](){const _0x2299bb=this[_0x4e11('0xb')];this[_0x4e11('0x3f')][_0x4e11('0x53')](),_0x2299bb[_0x4e11('0x12')]&&this[_0x4e11('0x19')]();}['_showBalloon'](_0x523982){if(this['_manuallyClosedAnnotationViews'][_0x4e11('0x56')](_0x523982[_0x4e11('0x4a')]))return;const _0x5eb3e6=this['balloonPanelView'][_0x4e11('0x7')][_0x4e11('0x39')];_0x5eb3e6!==_0x523982[_0x4e11('0x4a')]?(_0x5eb3e6&&this[_0x4e11('0x32')](_0x5eb3e6),this[_0x4e11('0x1e')](_0x523982[_0x4e11('0x4a')]),this[_0x4e11('0xb')][_0x4e11('0x7')][_0x4e11('0x3e')](),this[_0x4e11('0xb')][_0x4e11('0x7')][_0x4e11('0x10')](_0x523982[_0x4e11('0x4a')]),this[_0x4e11('0x19')]()):this[_0x4e11('0x19')]();}['_updateBalloonPosition'](){const _0x12cd67=this['balloonPanelView'][_0x4e11('0x7')][_0x4e11('0x39')],_0x5a51bb=_0x12cd67&&this[_0x4e11('0x3f')]['getByView'](_0x12cd67);if(!_0x5a51bb||!this[_0x4e11('0x27')][_0x4e11('0x56')](_0x5a51bb))return;const _0x4aaa93=this[_0x4e11('0x27')]['get'](_0x5a51bb)[_0x4e11('0x47')],_0x5b6f68=function(){const _0x196fe2=_0x35ae86[_0x4e11('0x14')];return[_0x196fe2[_0x4e11('0x30')],_0x196fe2[_0x4e11('0x52')],_0x196fe2[_0x4e11('0x29')],_0x196fe2['northArrowSouth'],_0x196fe2[_0x4e11('0x42')],_0x196fe2['northArrowSouthWest']];}();this['balloonPanelView']['pin']({'target':_0x4aaa93,'positions':_0x5b6f68});}['_hideBalloon'](){const _0x38116a=this[_0x4e11('0xb')],_0x7f9772=_0x38116a[_0x4e11('0x7')][_0x4e11('0x39')];_0x7f9772&&(this[_0x4e11('0x32')](_0x7f9772),_0x38116a['unpin'](),_0x38116a[_0x4e11('0x7')][_0x4e11('0x3e')]());}[_0x4e11('0x1e')](_0x50e122){this['listenTo'](_0x50e122,_0x4e11('0x4'),()=>this[_0x4e11('0x19')]()),this[_0x4e11('0x40')](_0x50e122,_0x4e11('0x6'),(_0x4c10cf,_0x5c9bc9)=>{this[_0x4e11('0x51')]['add'](_0x50e122),this[_0x4e11('0x54')](),_0x5c9bc9();});}[_0x4e11('0x32')](_0x2e38fe){this[_0x4e11('0x3d')](_0x2e38fe);}}
|
|
23
|
+
const _0x5810=['set:container','defaultPositions','detachFromDom','EditorAnnotations','_detachFromContainer','ck-sidebar--narrow','low','off','addAnnotation','ready','_detachListeners','annotations','type','attachToDom','attach','values','cancel','refresh','view','_editorAnnotations','listenTo','stopListening','activeAnnotation','focus','set','create','pluginName','keydown','_refreshPositioning','narrowsidebar-detach-not-attached','remove','refreshPositioning','mousedown','_updateBalloonPosition','plugins','blur','change:height','rearrange','locale','addEventListener','context','element','_attachListeners','stop','balloonPanelView','has','_annotations','length','_hideBalloon','getByView','bind','_selectedAnnotations','high','_refreshPositioningDebounced','stopPropagation','change:container','_destroyEditorAnnotationsIntegration','register','_showBalloon','northArrowSouth','_attachToContainer','keyCode','first','content','getOrderedSelectedAnnotations','pin','southArrowNorth','destroy','bodyCollection','setActiveAnnotation','_integrateWithEditorAnnotations','includes','Esc','contains','isAttached','get','southArrowNorthEast','init','_domEmitter','_manuallyClosedAnnotationViews','target','removeEventListener','clear','add','resize','isVisible','find','focusableElements','preventClosingBalloon','_annotationToNarrowView','from','detach','editors','isDirty','esc','_setSelectedAnnotations','unpin','getSidebarItemView','northArrowSouthEast'];(function(_0x234332,_0x58107b){const _0x4065f5=function(_0x29a4cb){while(--_0x29a4cb){_0x234332['push'](_0x234332['shift']());}};_0x4065f5(++_0x58107b);}(_0x5810,0xf8));const _0x4065=function(_0x234332,_0x58107b){_0x234332=_0x234332-0x0;let _0x4065f5=_0x5810[_0x234332];return _0x4065f5;};import{ContextPlugin as _0x4f06e5,Context as _0x3e23e7}from'ckeditor5/src/core';import _0x45bdb8 from'./annotationsuis';import _0x5a7657 from'./sidebar';import _0x224f7b from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x1857a0,BodyCollection as _0x5c7895}from'ckeditor5/src/ui';import{CKEditorError as _0x3de951,DomEmitterMixin as _0x12982f,keyCodes as _0x12095a,Collection as _0x1895f3}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x41dcaa}from'lodash-es';import _0x223216 from'./editorannotations';export default class s extends _0x4f06e5{static get['requires'](){return[_0x5a7657,_0x45bdb8];}static get[_0x4065('0x4b')](){return'NarrowSidebar';}constructor(_0xce335d){super(_0xce335d),this[_0x4065('0x18')]=!0x1,this[_0x4065('0x1d')]=new Set(),this[_0x4065('0x1c')]=Object[_0x4065('0x4a')](_0x12982f),this['_annotationToNarrowView']=new Map(),this[_0x4065('0x49')]('activeAnnotation',null),this[_0x4065('0x3c')]=null,this[_0x4065('0x1')]=[],this[_0x4065('0x44')]=new _0x1895f3(),this[_0x4065('0x3')]=_0x41dcaa(()=>{this[_0x4065('0x4d')]();},0xfa,{'leading':!0x1});}[_0x4065('0x1b')](){this[_0x4065('0x59')][_0x4065('0x53')][_0x4065('0x19')](_0x45bdb8)[_0x4065('0x7')]('narrowSidebar',this),this[_0x4065('0x12')]=new _0x5c7895(this['context']['locale']),this[_0x4065('0x5d')]=new _0x1857a0(this[_0x4065('0x59')][_0x4065('0x57')]),this[_0x4065('0x12')][_0x4065('0x3e')](),this[_0x4065('0x12')]['add'](this[_0x4065('0x5d')]);}[_0x4065('0x3f')](_0x55986e){this[_0x4065('0x3c')]=_0x55986e;const _0x2ade75=this[_0x4065('0x59')][_0x4065('0x53')]['get'](_0x5a7657),_0x500d5e=this['balloonPanelView'];if(_0x2ade75[_0x4065('0x5f')]=_0x55986e,this['isAttached'])throw new _0x3de951('narrowsidebar-attach-already-attached',this);this[_0x4065('0x18')]=!0x0,this['listenTo'](_0x2ade75,_0x4065('0x31'),()=>{this[_0x4065('0x29')](),this[_0x4065('0x45')](_0x2ade75,_0x4065('0x5'),_0x31880f=>{_0x31880f[_0x4065('0x38')](),this[_0x4065('0x3f')](_0x55986e);});}),_0x2ade75[_0x4065('0xa')]({'viewClass':_0x4065('0x36'),'spaceBetweenItems':0x5});const _0x20bfde=_0x4ee64e=>{const _0x486ca1=new _0x224f7b(this['context'][_0x4065('0x57')]);_0x2ade75[_0x4065('0x39')](_0x4ee64e,_0x486ca1),this[_0x4065('0x27')]['set'](_0x4ee64e,_0x486ca1),_0x486ca1[_0x4065('0x0')](_0x4065('0x2b'),'annotationType','number')['to'](_0x4ee64e[_0x4065('0x43')],_0x4065('0x2b'),_0x4065('0x3d'),_0x4065('0x60')),_0x486ca1['on']('execute',()=>{this[_0x4065('0x1d')]['clear'](),_0x500d5e['content']['first']!==_0x4ee64e[_0x4065('0x43')]?(this[_0x4065('0x8')](_0x4ee64e),_0x4ee64e[_0x4065('0x43')][_0x4065('0x5a')][_0x4065('0x48')](),this[_0x4065('0x13')](_0x4ee64e)):this[_0x4065('0x13')](null);});};for(const _0x3e6321 of _0x55986e)_0x20bfde(_0x3e6321);this['listenTo'](_0x55986e,'add',(_0x4f52e3,_0x3665c1)=>{_0x20bfde(_0x3665c1);}),this['listenTo'](_0x55986e,_0x4065('0x4f'),(_0x52cb31,_0x513f9f,_0x858bed)=>{this[_0x4065('0x27')][_0x4065('0x19')](_0x513f9f)['destroy'](),this[_0x4065('0x27')]['delete'](_0x513f9f),_0x2ade75[_0x4065('0x56')]({'removedAnnotation':_0x513f9f,'previousAnnotation':_0x55986e[_0x4065('0x19')](_0x858bed-0x1),'nextAnnotation':_0x55986e[_0x4065('0x19')](_0x858bed+0x1)}),_0x513f9f===this[_0x4065('0x47')]&&this['setActiveAnnotation'](null);},{'priority':_0x4065('0x37')}),this[_0x4065('0x45')](_0x55986e,_0x4065('0x48'),(_0x3373c7,_0x124402)=>{this[_0x4065('0x13')](_0x124402);}),this[_0x4065('0x45')](_0x55986e,_0x4065('0x54'),()=>{this[_0x4065('0x13')](null);}),this['_domEmitter'][_0x4065('0x45')](document,_0x4065('0x4c'),(_0x39664d,_0x140460)=>{_0x140460[_0x4065('0xb')]===_0x12095a[_0x4065('0x2c')]&&_0x500d5e[_0x4065('0x23')]&&(this[_0x4065('0x1d')]['add'](_0x500d5e[_0x4065('0xd')][_0x4065('0xc')]),this[_0x4065('0x61')](),_0x140460[_0x4065('0x4')](),_0x140460['preventDefault']());}),this['_domEmitter']['listenTo'](document,_0x4065('0x51'),(_0x3d17a0,_0x4eee4e)=>{const _0x4e26fc=_0x4eee4e[_0x4065('0x1e')];_0x500d5e[_0x4065('0x23')]&&_0x500d5e[_0x4065('0x5a')][_0x4065('0x17')](_0x4e26fc)||_0x2ade75[_0x4065('0x43')][_0x4065('0x5a')][_0x4065('0x17')](_0x4e26fc)||_0x3d17a0[_0x4065('0x26')]||this['activeAnnotation']&&this[_0x4065('0x47')][_0x4065('0x25')][_0x4065('0x24')](_0x1ec7b2=>_0x1ec7b2[_0x4065('0x17')](_0x4e26fc))||(this[_0x4065('0x1d')][_0x4065('0x20')](),this[_0x4065('0x61')](),this['setActiveAnnotation'](null));});const _0x5c7a94=this['context']instanceof _0x3e23e7?this[_0x4065('0x59')]['editors']:new _0x1895f3([this['context']]);for(const _0x107c5f of _0x5c7a94)this[_0x4065('0x14')](_0x107c5f);this[_0x4065('0x45')](_0x5c7a94,_0x4065('0x21'),(_0x1b466e,_0x2c05d2)=>{this[_0x4065('0x45')](_0x2c05d2,_0x4065('0x3a'),()=>{this[_0x4065('0x14')](_0x2c05d2);});}),this['listenTo'](_0x5c7a94,_0x4065('0x4f'),(_0x1643e6,_0x5abbc3)=>{_0x5abbc3[_0x4065('0x53')][_0x4065('0x5e')](_0x4065('0x34'))&&this['_destroyEditorAnnotationsIntegration'](_0x5abbc3[_0x4065('0x53')][_0x4065('0x19')](_0x4065('0x34')));}),window[_0x4065('0x58')](_0x4065('0x22'),this['_refreshPositioningDebounced']),this[_0x4065('0x4d')]();}[_0x4065('0x13')](_0x130086){if(_0x130086===this[_0x4065('0x47')])return;const _0x37fdf9=this[_0x4065('0x59')]['plugins'][_0x4065('0x19')](_0x5a7657);if(_0x37fdf9[_0x4065('0x42')]({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x130086,'disableAnimationOnActivatedAnnotation':!0x0}),_0x130086)_0x37fdf9[_0x4065('0x2f')](_0x130086)?this['_showBalloon'](_0x130086):this['_hideBalloon']();else this['_hideBalloon']();this[_0x4065('0x47')]=_0x130086;}[_0x4065('0x29')](){if(!this[_0x4065('0x18')])throw new _0x3de951(_0x4065('0x4e'),this);this[_0x4065('0x13')](null);const _0x405115=this[_0x4065('0x59')][_0x4065('0x53')][_0x4065('0x19')](_0x5a7657);this['_hideBalloon'](),Array[_0x4065('0x28')](this[_0x4065('0x27')][_0x4065('0x40')](),_0x4339d7=>_0x4339d7[_0x4065('0x11')]()),this[_0x4065('0x27')][_0x4065('0x20')](),_0x405115[_0x4065('0x35')](this[_0x4065('0x3c')]),this[_0x4065('0x46')](),this[_0x4065('0x1c')][_0x4065('0x46')](),this['context']instanceof _0x3e23e7&&this[_0x4065('0x46')](this[_0x4065('0x59')][_0x4065('0x2a')]);for(const _0x2ce006 of Array['from'](this[_0x4065('0x44')]))this[_0x4065('0x6')](_0x2ce006);window[_0x4065('0x1f')](_0x4065('0x22'),this['_refreshPositioningDebounced']),this[_0x4065('0x3')][_0x4065('0x41')](),this['_selectedAnnotations']=[],this[_0x4065('0x18')]=!0x1,this[_0x4065('0x3c')]=null;}['destroy'](){this[_0x4065('0x18')]&&this[_0x4065('0x29')](),this[_0x4065('0x12')][_0x4065('0x33')]();}['_integrateWithEditorAnnotations'](_0x5df19e){const _0x244233=_0x5df19e['plugins']['get'](_0x223216),_0xa0d878=this[_0x4065('0x59')][_0x4065('0x53')][_0x4065('0x19')](_0x5a7657),_0x55b2e1=this['annotations'],_0x1c7e84=this[_0x4065('0x5d')],_0x159469=()=>{const _0xed93d2=_0x244233[_0x4065('0xe')]({'annotations':this[_0x4065('0x3c')],'activeAnnotation':this[_0x4065('0x47')]});this[_0x4065('0x2d')](_0xed93d2),this['setActiveAnnotation'](_0xed93d2[0x0]||null);};this['listenTo'](_0x244233,_0x4065('0x42'),_0x159469),this['listenTo'](_0x244233,_0x4065('0x54'),(_0x386bb0,{isAnnotationTracked:_0x3fe743})=>{this[_0x4065('0x47')]&&_0x3fe743(this['activeAnnotation'])&&(this[_0x4065('0x2d')]([]),this['setActiveAnnotation'](null));}),this[_0x4065('0x45')](_0x244233,'uiUpdate',()=>{this['_refreshPositioningDebounced']();}),this[_0x4065('0x45')](_0x55b2e1,_0x4065('0x54'),_0x46a8ae=>{_0x244233['hasDomSelection']()&&_0x46a8ae[_0x4065('0x5c')]();},{'priority':_0x4065('0x2')}),this['listenTo'](this['_domEmitter'],_0x4065('0x51'),(_0x56dd77,_0x4c69c0)=>{const _0x3f29c9=_0x4c69c0['target'];_0x1c7e84['isVisible']&&_0x1c7e84['element']['contains'](_0x3f29c9)||_0xa0d878[_0x4065('0x43')]['element']['contains'](_0x3f29c9)||this[_0x4065('0x47')]&&_0x244233['hasDomSelection']()&&(_0x159469(),_0x56dd77[_0x4065('0x26')]=!0x0);},{'priority':_0x4065('0x2')}),this[_0x4065('0x44')]['add'](_0x244233);}[_0x4065('0x6')](_0x56e601){_0x56e601&&(this[_0x4065('0x46')](_0x56e601),this[_0x4065('0x44')]['remove'](_0x56e601));}['_setSelectedAnnotations'](_0x5cade3){for(const _0x54257e of this[_0x4065('0x1')])_0x5cade3[_0x4065('0x15')](_0x54257e)||this[_0x4065('0x1d')]['delete'](_0x54257e[_0x4065('0x43')]);this[_0x4065('0x1')]=_0x5cade3;}[_0x4065('0x4d')](){const _0x45646d=this[_0x4065('0x5d')];this[_0x4065('0x3c')][_0x4065('0x50')](),_0x45646d[_0x4065('0x23')]&&this[_0x4065('0x52')]();}[_0x4065('0x8')](_0x36bb06){if(this['_manuallyClosedAnnotationViews'][_0x4065('0x5e')](_0x36bb06[_0x4065('0x43')]))return;const _0x4b672a=this[_0x4065('0x5d')][_0x4065('0xd')][_0x4065('0xc')];_0x4b672a!==_0x36bb06[_0x4065('0x43')]?(_0x4b672a&&this[_0x4065('0x3b')](_0x4b672a),this[_0x4065('0x5b')](_0x36bb06[_0x4065('0x43')]),this[_0x4065('0x5d')][_0x4065('0xd')]['clear'](),this[_0x4065('0x5d')][_0x4065('0xd')]['add'](_0x36bb06[_0x4065('0x43')]),this['_updateBalloonPosition']()):this['_updateBalloonPosition']();}[_0x4065('0x52')](){const _0x359070=this['balloonPanelView'][_0x4065('0xd')][_0x4065('0xc')],_0x31e857=_0x359070&&this[_0x4065('0x3c')][_0x4065('0x62')](_0x359070);if(!_0x31e857||!this[_0x4065('0x27')][_0x4065('0x5e')](_0x31e857))return;const _0x42aabc=this['_annotationToNarrowView']['get'](_0x31e857)[_0x4065('0x5a')],_0x2c420a=function(){const _0x370962=_0x1857a0[_0x4065('0x32')];return[_0x370962[_0x4065('0x1a')],_0x370962[_0x4065('0x30')],_0x370962[_0x4065('0x10')],_0x370962[_0x4065('0x9')],_0x370962['southArrowNorthWest'],_0x370962['northArrowSouthWest']];}();this[_0x4065('0x5d')][_0x4065('0xf')]({'target':_0x42aabc,'positions':_0x2c420a});}[_0x4065('0x61')](){const _0x2e4a73=this[_0x4065('0x5d')],_0x5d7881=_0x2e4a73['content'][_0x4065('0xc')];_0x5d7881&&(this[_0x4065('0x3b')](_0x5d7881),_0x2e4a73[_0x4065('0x2e')](),_0x2e4a73['content']['clear']());}[_0x4065('0x5b')](_0x3afedb){this['listenTo'](_0x3afedb,_0x4065('0x55'),()=>this[_0x4065('0x52')]()),this['listenTo'](_0x3afedb,_0x4065('0x16'),(_0x1c00a1,_0x37ceef)=>{this[_0x4065('0x1d')][_0x4065('0x21')](_0x3afedb),this[_0x4065('0x61')](),_0x37ceef();});}['_detachListeners'](_0x3083e0){this[_0x4065('0x46')](_0x3083e0);}}
|
|
@@ -1,100 +1,100 @@
|
|
|
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/annotations/sidebar
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
|
|
10
|
-
import type { View } from 'ckeditor5/src/ui';
|
|
11
|
-
import SidebarView from './view/sidebarview';
|
|
12
|
-
import SidebarItemView from './view/sidebaritemview';
|
|
13
|
-
import type Annotation from './annotation';
|
|
14
|
-
/**
|
|
15
|
-
* Displays {@link module:comments/annotations/annotationcollection~AnnotationCollection annotations} inside a sidebar.
|
|
16
|
-
*
|
|
17
|
-
* `Sidebar` provides a {@link module:comments/annotations/view/sidebarview~SidebarView} which can be injected at any place on a website.
|
|
18
|
-
*
|
|
19
|
-
* It's main role is to display and correctly position annotation views added to the sidebar, accordingly to their target elements
|
|
20
|
-
* or `Rect`s.
|
|
21
|
-
*
|
|
22
|
-
* The following plugins use `Sidebar` to provide annotations UI:
|
|
23
|
-
*
|
|
24
|
-
* * {@link module:comments/annotations/widesidebar~WideSidebar}
|
|
25
|
-
* * {@link module:comments/annotations/narrowsidebar~NarrowSidebar}
|
|
26
|
-
*
|
|
27
|
-
* The sidebar plugin introduces {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} which is a wrapper view for
|
|
28
|
-
* {@link module:comments/annotations/view/annotationview~AnnotationView}. It adds an interface needed for positioning views inside
|
|
29
|
-
* the sidebar.
|
|
30
|
-
*
|
|
31
|
-
* Structure of items:
|
|
32
|
-
*
|
|
33
|
-
* |-> SidebarItemView -> AnnotationView -> added View
|
|
34
|
-
* Sidebar#view#list -|-> SidebarItemView -> AnnotationView -> added View
|
|
35
|
-
* |-> ...
|
|
36
|
-
*/
|
|
37
|
-
export default class Sidebar extends ContextPlugin {
|
|
38
|
-
/**
|
|
39
|
-
* Container element into which sidebar is injected (in the DOM).
|
|
40
|
-
*
|
|
41
|
-
* @observable
|
|
42
|
-
*/
|
|
43
|
-
container: HTMLElement | null;
|
|
44
|
-
/**
|
|
45
|
-
* Sidebar view.
|
|
46
|
-
*/
|
|
47
|
-
view: SidebarView;
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
static get pluginName(): "Sidebar";
|
|
52
|
-
/**
|
|
53
|
-
* @inheritDoc
|
|
54
|
-
*/
|
|
55
|
-
constructor(context: Context | Editor);
|
|
56
|
-
/**
|
|
57
|
-
* @inheritDoc
|
|
58
|
-
*/
|
|
59
|
-
init(): void;
|
|
60
|
-
/**
|
|
61
|
-
* Sets a new sidebar container.
|
|
62
|
-
*/
|
|
63
|
-
setContainer(container: HTMLElement): void;
|
|
64
|
-
/**
|
|
65
|
-
* Rearranges annotations when the annotation is removed.
|
|
66
|
-
*/
|
|
67
|
-
rearrange({ removedAnnotation, previousAnnotation, nextAnnotation }: {
|
|
68
|
-
removedAnnotation: Annotation;
|
|
69
|
-
previousAnnotation: Annotation | null;
|
|
70
|
-
nextAnnotation: Annotation | null;
|
|
71
|
-
}): void;
|
|
72
|
-
/**
|
|
73
|
-
* Refreshes sidebar items when one of the annotations is activated.
|
|
74
|
-
*
|
|
75
|
-
* @param options.activatedAnnotation The activated annotation.
|
|
76
|
-
* @param options.blurredAnnotation The previously active annotation.
|
|
77
|
-
* @param options.disableAnimationOnActivatedAnnotation Disables animation on the activated annotation.
|
|
78
|
-
*/
|
|
79
|
-
refresh({ blurredAnnotation, activatedAnnotation, disableAnimationOnActivatedAnnotation }: {
|
|
80
|
-
blurredAnnotation: Annotation | null;
|
|
81
|
-
activatedAnnotation: Annotation | null;
|
|
82
|
-
disableAnimationOnActivatedAnnotation?: boolean;
|
|
83
|
-
}): void;
|
|
84
|
-
/**
|
|
85
|
-
* Creates new {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} and binds its
|
|
86
|
-
* position with {@link module:comments/annotations/view/annotationview~AnnotationView} target position.
|
|
87
|
-
*
|
|
88
|
-
* By default, annotation's view will be displayed in the sidebar. However, you can provide any other view
|
|
89
|
-
* to be displayed instead using `annotationToDisplay`. `annotation` will be then used only to gather data needed by `Sidebar`.
|
|
90
|
-
*/
|
|
91
|
-
addAnnotation(annotation: Annotation, viewToDisplay?: View): SidebarItemView;
|
|
92
|
-
/**
|
|
93
|
-
* Returns sidebar item view that wraps given annotation view.
|
|
94
|
-
*/
|
|
95
|
-
getSidebarItemView(annotation: Annotation): SidebarItemView | undefined;
|
|
96
|
-
/**
|
|
97
|
-
* @inheritDoc
|
|
98
|
-
*/
|
|
99
|
-
destroy(): void;
|
|
100
|
-
}
|
|
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/annotations/sidebar
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
|
|
10
|
+
import type { View } from 'ckeditor5/src/ui';
|
|
11
|
+
import SidebarView from './view/sidebarview';
|
|
12
|
+
import SidebarItemView from './view/sidebaritemview';
|
|
13
|
+
import type Annotation from './annotation';
|
|
14
|
+
/**
|
|
15
|
+
* Displays {@link module:comments/annotations/annotationcollection~AnnotationCollection annotations} inside a sidebar.
|
|
16
|
+
*
|
|
17
|
+
* `Sidebar` provides a {@link module:comments/annotations/view/sidebarview~SidebarView} which can be injected at any place on a website.
|
|
18
|
+
*
|
|
19
|
+
* It's main role is to display and correctly position annotation views added to the sidebar, accordingly to their target elements
|
|
20
|
+
* or `Rect`s.
|
|
21
|
+
*
|
|
22
|
+
* The following plugins use `Sidebar` to provide annotations UI:
|
|
23
|
+
*
|
|
24
|
+
* * {@link module:comments/annotations/widesidebar~WideSidebar}
|
|
25
|
+
* * {@link module:comments/annotations/narrowsidebar~NarrowSidebar}
|
|
26
|
+
*
|
|
27
|
+
* The sidebar plugin introduces {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} which is a wrapper view for
|
|
28
|
+
* {@link module:comments/annotations/view/annotationview~AnnotationView}. It adds an interface needed for positioning views inside
|
|
29
|
+
* the sidebar.
|
|
30
|
+
*
|
|
31
|
+
* Structure of items:
|
|
32
|
+
*
|
|
33
|
+
* |-> SidebarItemView -> AnnotationView -> added View
|
|
34
|
+
* Sidebar#view#list -|-> SidebarItemView -> AnnotationView -> added View
|
|
35
|
+
* |-> ...
|
|
36
|
+
*/
|
|
37
|
+
export default class Sidebar extends ContextPlugin {
|
|
38
|
+
/**
|
|
39
|
+
* Container element into which sidebar is injected (in the DOM).
|
|
40
|
+
*
|
|
41
|
+
* @observable
|
|
42
|
+
*/
|
|
43
|
+
container: HTMLElement | null;
|
|
44
|
+
/**
|
|
45
|
+
* Sidebar view.
|
|
46
|
+
*/
|
|
47
|
+
view: SidebarView;
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
static get pluginName(): "Sidebar";
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
constructor(context: Context | Editor);
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
init(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Sets a new sidebar container.
|
|
62
|
+
*/
|
|
63
|
+
setContainer(container: HTMLElement): void;
|
|
64
|
+
/**
|
|
65
|
+
* Rearranges annotations when the annotation is removed.
|
|
66
|
+
*/
|
|
67
|
+
rearrange({ removedAnnotation, previousAnnotation, nextAnnotation }: {
|
|
68
|
+
removedAnnotation: Annotation;
|
|
69
|
+
previousAnnotation: Annotation | null;
|
|
70
|
+
nextAnnotation: Annotation | null;
|
|
71
|
+
}): void;
|
|
72
|
+
/**
|
|
73
|
+
* Refreshes sidebar items when one of the annotations is activated.
|
|
74
|
+
*
|
|
75
|
+
* @param options.activatedAnnotation The activated annotation.
|
|
76
|
+
* @param options.blurredAnnotation The previously active annotation.
|
|
77
|
+
* @param options.disableAnimationOnActivatedAnnotation Disables animation on the activated annotation.
|
|
78
|
+
*/
|
|
79
|
+
refresh({ blurredAnnotation, activatedAnnotation, disableAnimationOnActivatedAnnotation }: {
|
|
80
|
+
blurredAnnotation: Annotation | null;
|
|
81
|
+
activatedAnnotation: Annotation | null;
|
|
82
|
+
disableAnimationOnActivatedAnnotation?: boolean;
|
|
83
|
+
}): void;
|
|
84
|
+
/**
|
|
85
|
+
* Creates new {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} and binds its
|
|
86
|
+
* position with {@link module:comments/annotations/view/annotationview~AnnotationView} target position.
|
|
87
|
+
*
|
|
88
|
+
* By default, annotation's view will be displayed in the sidebar. However, you can provide any other view
|
|
89
|
+
* to be displayed instead using `annotationToDisplay`. `annotation` will be then used only to gather data needed by `Sidebar`.
|
|
90
|
+
*/
|
|
91
|
+
addAnnotation(annotation: Annotation, viewToDisplay?: View): SidebarItemView;
|
|
92
|
+
/**
|
|
93
|
+
* Returns sidebar item view that wraps given annotation view.
|
|
94
|
+
*/
|
|
95
|
+
getSidebarItemView(annotation: Annotation): SidebarItemView | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* @inheritDoc
|
|
98
|
+
*/
|
|
99
|
+
destroy(): void;
|
|
100
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x61e3=['_detachFromContainer','_getTargetTop','view','_alignAfterItem','clear','_attachToContainer','sidebar.preventScrollOutOfView','container','define','class','_alignBeforeItem','destroy','init','_targetTop','addAnnotation','_annotationToSidebarItemView','remove','rearrange','targetRect','_getItemAfter','unbind','refresh','_destroySidebarItemView','push','content','updateHeight','max','_spaceBetweenItems','sidebar-attachtocontainer-missing-container','_alignForBottomChange','top','listenTo','add','change:top','_lastItem','bind','last','sidebar.container','_setItemTop','_getItemBefore','getSidebarItemView','_alignToTargetRect','object','minHeight','isActive','_recalculateBuffer','Sidebar','target','stopListening','_sidebarItemViewToAnnotation','list','_getMaxAvailableTop','_activeAnnotation','locale','change:targetRect','_annotations','delete','change:_lastItem','element','render','_alignForTopChange','isAnimationDisabled','context','length','getIndex','setContainer','_recalculate','height','nodeType','get','config','bottom','set'];(function(_0x3ba738,_0x61e3ae){const _0x1ac253=function(_0x5e5263){while(--_0x5e5263){_0x3ba738['push'](_0x3ba738['shift']());}};_0x1ac253(++_0x61e3ae);}(_0x61e3,0x15e));const _0x1ac2=function(_0x3ba738,_0x61e3ae){_0x3ba738=_0x3ba738-0x0;let _0x1ac253=_0x61e3[_0x3ba738];return _0x1ac253;};import{ContextPlugin as _0x9dd49a}from'ckeditor5/src/core';import{Rect as _0x7d5fc2,CKEditorError as _0x328776}from'ckeditor5/src/utils';import _0x279edf from'./view/sidebarview';import _0x3059d1 from'./view/sidebaritemview';export default class z extends _0x9dd49a{static get['pluginName'](){return _0x1ac2('0x3d');}constructor(_0xe05963){super(_0xe05963),this[_0x1ac2('0xe')](_0x1ac2('0x31'),void 0x0),this[_0x1ac2('0x11')]=this['_createSidebarView'](),this['set'](_0x1ac2('0x16'),null),this[_0x1ac2('0x2a')]=0x19,this[_0x1ac2('0x40')]=new Map(),this['_annotationToSidebarItemView']=new Map(),this[_0x1ac2('0x4')][_0x1ac2('0xc')][_0x1ac2('0x17')]('sidebar.preventScrollOutOfView',!0x1),this[_0x1ac2('0x46')]=null,this['_activeAnnotation']=null,this['_recalculateBuffer']=[];}[_0x1ac2('0x1b')](){const _0xf6ba1e=this[_0x1ac2('0x4')][_0x1ac2('0xc')]['get'](_0x1ac2('0x34'));_0xf6ba1e&&this['setContainer'](_0xf6ba1e);}[_0x1ac2('0x7')](_0x2e9f1f){if(!y(_0x2e9f1f))throw new _0x328776('sidebar-setcontainer-invalid-element');this[_0x1ac2('0x16')]=_0x2e9f1f;}[_0x1ac2('0x14')]({viewClass:_0x59a388='',spaceBetweenItems:_0x59d3e5=0x19}={}){if(!y(this[_0x1ac2('0x16')]))throw new _0x328776(_0x1ac2('0x2b'),this);this[_0x1ac2('0x16')]['appendChild'](this[_0x1ac2('0x11')][_0x1ac2('0x0')]),this['view'][_0x1ac2('0x18')]=_0x59a388,this['_spaceBetweenItems']=_0x59d3e5;}[_0x1ac2('0x20')]({removedAnnotation:_0x416ed7,previousAnnotation:_0x20551a,nextAnnotation:_0x20d702}){const _0x44868b=this[_0x1ac2('0x37')](_0x416ed7);this[_0x1ac2('0x11')][_0x1ac2('0x41')][_0x1ac2('0x1f')](_0x44868b),this['_destroySidebarItemView'](_0x416ed7),_0x20551a&&this['_alignToTargetRect'](this[_0x1ac2('0x37')](_0x20551a)),_0x20d702&&this[_0x1ac2('0x38')](this['getSidebarItemView'](_0x20d702)),this['_updateLastItem']();}[_0x1ac2('0x24')]({blurredAnnotation:_0xa65fb6,activatedAnnotation:_0x23f4ca,disableAnimationOnActivatedAnnotation:_0x31de5c}){if(this[_0x1ac2('0x43')]=_0x23f4ca,_0xa65fb6){_0xa65fb6[_0x1ac2('0x3b')]=!0x1;const _0x1dc418=this[_0x1ac2('0x37')](_0xa65fb6);_0x1dc418&&_0x31de5c&&(_0x1dc418[_0x1ac2('0x3')]=!0x1);}if(_0x23f4ca){const _0x5d47b2=this[_0x1ac2('0x37')](_0x23f4ca);_0x5d47b2&&(_0x23f4ca[_0x1ac2('0x3b')]=!0x0,_0x31de5c&&(_0x5d47b2[_0x1ac2('0x3')]=!0x0,_0x5d47b2[_0x1ac2('0x2d')]+=0x1),this[_0x1ac2('0x38')](_0x5d47b2));}}[_0x1ac2('0xf')](_0x34dc4c){if(this['view'][_0x1ac2('0x0')]['remove'](),_0x34dc4c)for(const _0x43176b of _0x34dc4c)this[_0x1ac2('0x25')](_0x43176b);this[_0x1ac2('0x11')][_0x1ac2('0x41')][_0x1ac2('0x13')](),this[_0x1ac2('0x11')]['class']='',this['_lastItem']=null;}[_0x1ac2('0x1d')](_0x46bd19,_0x38b9ef){_0x38b9ef||(_0x38b9ef=_0x46bd19['view']);const _0x5f2ec9=new _0x3059d1(this[_0x1ac2('0x4')]['locale']);this['_sidebarItemViewToAnnotation'][_0x1ac2('0xe')](_0x5f2ec9,_0x46bd19),this['_annotationToSidebarItemView'][_0x1ac2('0xe')](_0x46bd19,_0x5f2ec9),_0x5f2ec9[_0x1ac2('0x27')][_0x1ac2('0x2f')](_0x38b9ef),this[_0x1ac2('0x2e')](_0x46bd19[_0x1ac2('0x11')],_0x1ac2('0x45'),(_0x4c8a6c,_0x21ea7b,_0x1f2cfc)=>{const _0x25dc68=this['_getTargetTop'](_0x46bd19,_0x1f2cfc);_0x5f2ec9[_0x1ac2('0x1c')]!=_0x25dc68&&(_0x5f2ec9[_0x1ac2('0x1c')]=_0x25dc68,this[_0x1ac2('0x35')](_0x5f2ec9,_0x25dc68));}),this[_0x1ac2('0x2e')](_0x5f2ec9,_0x1ac2('0x30'),()=>{this[_0x1ac2('0x8')](_0x5f2ec9,'top');}),this['listenTo'](_0x5f2ec9,'change:bottom',()=>{this['_recalculate'](_0x5f2ec9,_0x1ac2('0xd'));}),this[_0x1ac2('0x38')](_0x5f2ec9);const _0x101c74=this[_0x1ac2('0x36')](_0x5f2ec9);if(_0x101c74)this['_alignAfterItem'](_0x101c74,_0x5f2ec9)||this[_0x1ac2('0x38')](_0x5f2ec9);else this[_0x1ac2('0x38')](_0x5f2ec9);return this['_updateLastItem'](),this[_0x1ac2('0x11')][_0x1ac2('0x41')][_0x1ac2('0x2f')](_0x5f2ec9),_0x5f2ec9;}[_0x1ac2('0x2')](_0x31bce0){if(!_0x31bce0[_0x1ac2('0x27')][_0x1ac2('0x5')])return;const _0x311064=this['_getItemBefore'](_0x31bce0);if(!_0x311064)return;const _0x663ef6=this[_0x1ac2('0x40')][_0x1ac2('0xb')](_0x311064),_0x3a7441=this[_0x1ac2('0x43')];_0x3a7441&&_0x3a7441===_0x663ef6?this[_0x1ac2('0x12')](_0x311064,_0x31bce0):this['_alignBeforeItem'](_0x31bce0,_0x311064);}[_0x1ac2('0x2c')](_0x5a0332){if(!_0x5a0332['content'][_0x1ac2('0x5')])return;const _0x13aadc=this[_0x1ac2('0x22')](_0x5a0332);if(!_0x13aadc)return;const _0x171284=this[_0x1ac2('0x40')][_0x1ac2('0xb')](_0x13aadc),_0x546d21=this[_0x1ac2('0x4')]['config'][_0x1ac2('0xb')](_0x1ac2('0x15')),_0x2b192a=this[_0x1ac2('0x43')];_0x2b192a&&_0x2b192a===_0x171284&&_0x546d21?(this['_alignBeforeItem'](_0x13aadc,_0x5a0332),this[_0x1ac2('0x12')](_0x5a0332,_0x13aadc)):_0x2b192a&&_0x2b192a===_0x171284?this[_0x1ac2('0x19')](_0x13aadc,_0x5a0332):this[_0x1ac2('0x12')](_0x5a0332,_0x13aadc);}[_0x1ac2('0x8')](_0x37ad05,_0x518dbb){0x0===this['_recalculateBuffer'][_0x1ac2('0x5')]&&setTimeout(()=>{for(const {sidebarItemView:_0x256bec,changedProp:_0x5ed6b7}of this['_recalculateBuffer'])_0x1ac2('0x2d')===_0x5ed6b7?this[_0x1ac2('0x2')](_0x256bec):this[_0x1ac2('0x2c')](_0x256bec);this[_0x1ac2('0x3c')]=[];},0xa),this[_0x1ac2('0x3c')][_0x1ac2('0x26')]({'sidebarItemView':_0x37ad05,'changedProp':_0x518dbb});}[_0x1ac2('0x37')](_0xbdfed4){return this[_0x1ac2('0x1e')][_0x1ac2('0xb')](_0xbdfed4);}[_0x1ac2('0x1a')](){this[_0x1ac2('0x3f')](),this[_0x1ac2('0x11')][_0x1ac2('0x1a')]();}[_0x1ac2('0x25')](_0x3b7a1c){const _0x1120aa=this[_0x1ac2('0x37')](_0x3b7a1c);this[_0x1ac2('0x3f')](_0x1120aa),this['stopListening'](_0x3b7a1c['view']),_0x1120aa[_0x1ac2('0x1a')](),this[_0x1ac2('0x1e')]['delete'](_0x3b7a1c),this[_0x1ac2('0x40')][_0x1ac2('0x47')](_0x1120aa);}['_createSidebarView'](){const _0x2058fa=new _0x279edf(this[_0x1ac2('0x4')][_0x1ac2('0x44')]);return _0x2058fa[_0x1ac2('0x1')](),this['on'](_0x1ac2('0x48'),(_0x20d437,_0x5bdfd8,_0x25caa0,_0x33a431)=>{_0x33a431&&_0x2058fa[_0x1ac2('0x23')](_0x1ac2('0x3a')),_0x25caa0?_0x2058fa[_0x1ac2('0x32')](_0x1ac2('0x3a'))['to'](_0x25caa0,'bottom'):_0x2058fa[_0x1ac2('0x3a')]=null;}),_0x2058fa;}['_updateLastItem'](){var _0x4905de;this[_0x1ac2('0x31')]=(null===(_0x4905de=this[_0x1ac2('0x46')])||void 0x0===_0x4905de?void 0x0:_0x4905de[_0x1ac2('0x33')])?this[_0x1ac2('0x37')](this['_annotations'][_0x1ac2('0x33')]):null;}['_getItemBefore'](_0x44c1c6){var _0x2d4b45;const _0xd1711d=this[_0x1ac2('0x40')][_0x1ac2('0xb')](_0x44c1c6),_0x2ed473=_0xd1711d&&(null===(_0x2d4b45=this[_0x1ac2('0x46')])||void 0x0===_0x2d4b45?void 0x0:_0x2d4b45['get'](this[_0x1ac2('0x46')][_0x1ac2('0x6')](_0xd1711d)-0x1));return _0x2ed473&&this['getSidebarItemView'](_0x2ed473)||null;}[_0x1ac2('0x22')](_0x2dcc4c){var _0x1584de;const _0x124255=this[_0x1ac2('0x40')]['get'](_0x2dcc4c),_0x4abfca=_0x124255&&(null===(_0x1584de=this[_0x1ac2('0x46')])||void 0x0===_0x1584de?void 0x0:_0x1584de['get'](this['_annotations'][_0x1ac2('0x6')](_0x124255)+0x1));return _0x4abfca&&this[_0x1ac2('0x37')](_0x4abfca)||null;}[_0x1ac2('0x19')](_0x24e797,_0x47d72c){_0x24e797['updateHeight']();const _0x4c6353=H(_0x47d72c[_0x1ac2('0xd')]+this[_0x1ac2('0x2a')],_0x24e797[_0x1ac2('0x2d')]);return!!_0x4c6353&&(this[_0x1ac2('0x35')](_0x47d72c,_0x47d72c['top']-_0x4c6353),!0x0);}[_0x1ac2('0x12')](_0x3958cb,_0xa09670){_0x3958cb[_0x1ac2('0x28')]();const _0x49579b=H(_0x3958cb[_0x1ac2('0xd')]+this[_0x1ac2('0x2a')],_0xa09670['top']);return!!_0x49579b&&(this['_setItemTop'](_0xa09670,_0xa09670[_0x1ac2('0x2d')]+_0x49579b,!0x1),!0x0);}[_0x1ac2('0x38')](_0x22e27e){const _0x563058=this[_0x1ac2('0x40')]['get'](_0x22e27e);if(!_0x563058||!_0x563058[_0x1ac2('0x3e')]||!_0x563058[_0x1ac2('0x21')])return;const _0x217310=this[_0x1ac2('0x10')](_0x563058,_0x563058['targetRect']);this[_0x1ac2('0x35')](_0x22e27e,_0x217310);}[_0x1ac2('0x10')](_0x132881,_0x2db3b1){if(null===_0x2db3b1)return 0x0;if(_0x132881[_0x1ac2('0x3e')]instanceof _0x7d5fc2)return _0x2db3b1['top'];{const _0x4d4b8d=new _0x7d5fc2(this[_0x1ac2('0x11')][_0x1ac2('0x0')])[_0x1ac2('0x2d')];return _0x2db3b1[_0x1ac2('0x2d')]-_0x4d4b8d;}}[_0x1ac2('0x35')](_0x5d80e9,_0x1c34a9,_0x5bc6b6=this[_0x1ac2('0x4')][_0x1ac2('0xc')][_0x1ac2('0xb')](_0x1ac2('0x15'))){_0x5bc6b6&&(_0x1c34a9=Math[_0x1ac2('0x29')](_0x1c34a9,this[_0x1ac2('0x42')](_0x5d80e9))),_0x5d80e9['top']=_0x1c34a9;}[_0x1ac2('0x42')](_0x538faf){let _0x1bb974=this[_0x1ac2('0x36')](_0x538faf),_0x5f4212=0x0;for(;_0x1bb974;)_0x1bb974['updateHeight'](),_0x5f4212+=this[_0x1ac2('0x2a')]+_0x1bb974[_0x1ac2('0x9')],_0x1bb974=this[_0x1ac2('0x36')](_0x1bb974);return _0x5f4212;}}function H(_0x3f8903,_0x18ff59){return Math[_0x1ac2('0x29')](_0x3f8903-_0x18ff59,0x0);}function y(_0x3d3024){return null!==_0x3d3024&&_0x1ac2('0x39')==typeof _0x3d3024&&0x1===_0x3d3024[_0x1ac2('0xa')];}
|
|
@@ -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
|
-
/**
|
|
6
|
-
* @module comments/annotations/view/annotationcounterbuttonview
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { ButtonView, View } from 'ckeditor5/src/ui';
|
|
10
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
11
|
-
/**
|
|
12
|
-
* A view used in the sidebar by {@link module:comments/annotations/narrowsidebar~NarrowSidebar}.
|
|
13
|
-
*/
|
|
14
|
-
export default class AnnotationCounterButtonView extends ButtonView {
|
|
15
|
-
/**
|
|
16
|
-
* @observable
|
|
17
|
-
*/
|
|
18
|
-
isDirty: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* @observable
|
|
21
|
-
*/
|
|
22
|
-
number: number;
|
|
23
|
-
/**
|
|
24
|
-
* @observable
|
|
25
|
-
*/
|
|
26
|
-
annotationType: string;
|
|
27
|
-
counterView: View;
|
|
28
|
-
constructor(locale: Locale);
|
|
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
|
+
/**
|
|
6
|
+
* @module comments/annotations/view/annotationcounterbuttonview
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ButtonView, View } from 'ckeditor5/src/ui';
|
|
10
|
+
import type { Locale } from 'ckeditor5/src/utils';
|
|
11
|
+
/**
|
|
12
|
+
* A view used in the sidebar by {@link module:comments/annotations/narrowsidebar~NarrowSidebar}.
|
|
13
|
+
*/
|
|
14
|
+
export default class AnnotationCounterButtonView extends ButtonView {
|
|
15
|
+
/**
|
|
16
|
+
* @observable
|
|
17
|
+
*/
|
|
18
|
+
isDirty: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @observable
|
|
21
|
+
*/
|
|
22
|
+
number: number;
|
|
23
|
+
/**
|
|
24
|
+
* @observable
|
|
25
|
+
*/
|
|
26
|
+
annotationType: string;
|
|
27
|
+
counterView: View;
|
|
28
|
+
constructor(locale: Locale);
|
|
29
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2780=['toString','ck-annotation-counter__badge--','bind','add','ck-annotation-counter','icon','children','annotationType','counterView','number','span','isDirty','extendTemplate','set','setTemplate'];(function(_0x17d0b2,_0x278032){const _0xb8a283=function(_0x820e97){while(--_0x820e97){_0x17d0b2['push'](_0x17d0b2['shift']());}};_0xb8a283(++_0x278032);}(_0x2780,0xc8));const _0xb8a2=function(_0x17d0b2,_0x278032){_0x17d0b2=_0x17d0b2-0x0;let _0xb8a283=_0x2780[_0x17d0b2];return _0xb8a283;};import{ButtonView as _0x3cc62e,View as _0x4d1d34}from'ckeditor5/src/ui';import _0x368277 from'../../../theme/icons/add-comment.svg';export default class D extends _0x3cc62e{constructor(_0x1213b3){super(_0x1213b3);const _0x5b44c5=this['bindTemplate'];this['set']('isDirty',!0x1),this[_0xb8a2('0x8')](_0xb8a2('0x4'),0x0),this[_0xb8a2('0xc')]('_badge')['to'](this,_0xb8a2('0x6'),this,'number',(_0x3589a5,_0x17982d)=>_0x3589a5?'...':_0x17982d[_0xb8a2('0xa')]()),this['set']('annotationType',''),this[_0xb8a2('0x0')]=_0x368277,this[_0xb8a2('0x7')]({'attributes':{'class':[_0xb8a2('0xe')]}}),this[_0xb8a2('0x3')]=new _0x4d1d34(),this[_0xb8a2('0x3')][_0xb8a2('0x9')]({'tag':_0xb8a2('0x5'),'attributes':{'class':['ck-annotation-counter__badge',_0x5b44c5['to'](_0xb8a2('0x2'),_0x27f2f2=>_0xb8a2('0xb')+_0x27f2f2),_0x5b44c5['if'](_0xb8a2('0x6'),'ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x5b44c5['to']('_badge')}]}),this[_0xb8a2('0x1')][_0xb8a2('0xd')](this['counterView']);}}
|