@ckeditor/ckeditor5-comments 38.0.1 → 38.1.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/build/comments.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sq.js +1 -0
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sq.po +111 -0
- package/package.json +10 -8
- package/src/annotations/annotation.d.ts +86 -86
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.d.ts +94 -94
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.d.ts +150 -150
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.d.ts +228 -227
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +63 -62
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +86 -84
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +81 -80
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.d.ts +96 -96
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -25
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.d.ts +86 -86
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.d.ts +51 -51
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.d.ts +28 -28
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.d.ts +73 -72
- package/src/annotations/widesidebar.js +1 -1
- package/src/augmentation.d.ts +48 -48
- package/src/comments/addcommentthreadcommand.d.ts +31 -31
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.d.ts +27 -25
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.d.ts +34 -32
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.d.ts +75 -71
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1088 -1084
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +29 -25
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -13
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.d.ts +17 -17
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -32
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -27
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -32
- 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 +108 -108
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.d.ts +108 -108
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -9
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.d.ts +10 -10
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.d.ts +82 -82
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.d.ts +34 -34
- package/src/comments/ui/view/commentsarchiveview.js +1 -1
- package/src/comments/ui/view/commentslistview.d.ts +96 -96
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -46
- package/src/comments/ui/view/commentthreadheaderview.js +1 -1
- package/src/comments/ui/view/commentthreadinputview.d.ts +37 -37
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.d.ts +113 -113
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.d.ts +239 -239
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.d.ts +31 -22
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +29 -28
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +172 -172
- package/src/index.d.ts +21 -19
- package/src/index.js +1 -1
- package/src/utils/common-translations.d.ts +5 -5
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.d.ts +13 -13
- package/src/utils/createmutationobserver.js +1 -1
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const _0x1c1c=['keydown','setActiveAnnotation','removeEventListener','destroy','rearrange','detach','_attachListeners','_showBalloon','change:container','add','stopPropagation','mousedown','context','narrowsidebar-attach-already-attached','esc','_annotationToNarrowView','northArrowSouthWest','_refreshPositioningDebounced','_detachListeners','bind','editors','northArrowSouthEast','southArrowNorthWest','refreshPositioning','getByView','remove','balloonPanelView','get','_attachToContainer','ck-sidebar--narrow','blur','view','detachFromDom','_updateBalloonPosition','element','_detachFromContainer','attachToDom','number','cancel','preventClosingBalloon','low','change:height','bodyCollection','NarrowSidebar','attach','annotations','init','contains','Esc','listenTo','stop','_hideBalloon','stopListening','_editorAnnotations','focus','includes','hasDomSelection','_setSelectedAnnotations','_selectedAnnotations','set:container','set','off','annotationType','content','isVisible','isDirty','addAnnotation','pin','defaultPositions','first','_destroyEditorAnnotationsIntegration','clear','delete','_refreshPositioning','resize','register','plugins','_domEmitter','isAttached','EditorAnnotations','southArrowNorth','has','_manuallyClosedAnnotationViews','from','requires','locale','getSidebarItemView','unpin','high','activeAnnotation','_integrateWithEditorAnnotations','addEventListener','uiUpdate'];(function(_0x2b57f2,_0x1c1c28){const _0x3c2cad=function(_0x3cc801){while(--_0x3cc801){_0x2b57f2['push'](_0x2b57f2['shift']());}};_0x3c2cad(++_0x1c1c28);}(_0x1c1c,0x11a));const _0x3c2c=function(_0x2b57f2,_0x1c1c28){_0x2b57f2=_0x2b57f2-0x0;let _0x3c2cad=_0x1c1c[_0x2b57f2];return _0x3c2cad;};import{ContextPlugin as _0x39b33d,Context as _0x482755}from'ckeditor5/src/core';import _0x5d97c4 from'./annotationsuis';import _0x41b3c8 from'./sidebar';import _0x3801c2 from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x2a46fc,BodyCollection as _0x451829}from'ckeditor5/src/ui';import{CKEditorError as _0x4759ee,DomEmitterMixin as _0x4aecff,keyCodes as _0x490116,Collection as _0xa5b00}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x14f141}from'lodash-es';import _0x5dabdb from'./editorannotations';export default class s extends _0x39b33d{static get[_0x3c2c('0x51')](){return[_0x41b3c8,_0x5d97c4];}static get['pluginName'](){return _0x3c2c('0x28');}constructor(_0x25afff){super(_0x25afff),this[_0x3c2c('0x4b')]=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this[_0x3c2c('0x4a')]=Object['create'](_0x4aecff),this[_0x3c2c('0xc')]=new Map(),this[_0x3c2c('0x39')]('activeAnnotation',null),this[_0x3c2c('0x2a')]=null,this[_0x3c2c('0x37')]=[],this[_0x3c2c('0x32')]=new _0xa5b00(),this[_0x3c2c('0xe')]=_0x14f141(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}[_0x3c2c('0x2b')](){this[_0x3c2c('0x9')][_0x3c2c('0x49')]['get'](_0x5d97c4)[_0x3c2c('0x48')]('narrowSidebar',this),this['bodyCollection']=new _0x451829(this[_0x3c2c('0x9')]['locale']),this[_0x3c2c('0x17')]=new _0x2a46fc(this['context'][_0x3c2c('0x52')]),this[_0x3c2c('0x27')][_0x3c2c('0x21')](),this[_0x3c2c('0x27')]['add'](this[_0x3c2c('0x17')]);}[_0x3c2c('0x29')](_0x3a0855){this[_0x3c2c('0x2a')]=_0x3a0855;const _0x2125d9=this[_0x3c2c('0x9')][_0x3c2c('0x49')][_0x3c2c('0x18')](_0x41b3c8),_0x27da25=this['balloonPanelView'];if(_0x2125d9['_annotations']=_0x3a0855,this[_0x3c2c('0x4b')])throw new _0x4759ee(_0x3c2c('0xa'),this);this[_0x3c2c('0x4b')]=!0x0,this[_0x3c2c('0x2e')](_0x2125d9,_0x3c2c('0x38'),()=>{this[_0x3c2c('0x2')](),this[_0x3c2c('0x2e')](_0x2125d9,_0x3c2c('0x5'),_0xdb40e3=>{_0xdb40e3[_0x3c2c('0x3a')](),this[_0x3c2c('0x29')](_0x3a0855);});}),_0x2125d9[_0x3c2c('0x19')]({'viewClass':_0x3c2c('0x1a'),'spaceBetweenItems':0x5});const _0x2b8637=_0x1a110e=>{const _0xca69ce=new _0x3801c2(this[_0x3c2c('0x9')][_0x3c2c('0x52')]);_0x2125d9[_0x3c2c('0x3f')](_0x1a110e,_0xca69ce),this[_0x3c2c('0xc')][_0x3c2c('0x39')](_0x1a110e,_0xca69ce),_0xca69ce[_0x3c2c('0x10')](_0x3c2c('0x3e'),_0x3c2c('0x3b'),_0x3c2c('0x22'))['to'](_0x1a110e[_0x3c2c('0x1c')],'isDirty','type','length'),_0xca69ce['on']('execute',()=>{this['_manuallyClosedAnnotationViews'][_0x3c2c('0x44')](),_0x27da25[_0x3c2c('0x3c')][_0x3c2c('0x42')]!==_0x1a110e[_0x3c2c('0x1c')]?(this[_0x3c2c('0x4')](_0x1a110e),_0x1a110e[_0x3c2c('0x1c')][_0x3c2c('0x1f')][_0x3c2c('0x33')](),this[_0x3c2c('0x5b')](_0x1a110e)):this[_0x3c2c('0x5b')](null);});};for(const _0x4de74e of _0x3a0855)_0x2b8637(_0x4de74e);this[_0x3c2c('0x2e')](_0x3a0855,_0x3c2c('0x6'),(_0xfce367,_0x4a07f0)=>{_0x2b8637(_0x4a07f0);}),this[_0x3c2c('0x2e')](_0x3a0855,'remove',(_0x23fa20,_0x52a221,_0x4cd56d)=>{this[_0x3c2c('0xc')][_0x3c2c('0x18')](_0x52a221)[_0x3c2c('0x0')](),this['_annotationToNarrowView'][_0x3c2c('0x45')](_0x52a221),_0x2125d9[_0x3c2c('0x1')]({'removedAnnotation':_0x52a221,'previousAnnotation':_0x3a0855['get'](_0x4cd56d-0x1),'nextAnnotation':_0x3a0855[_0x3c2c('0x18')](_0x4cd56d+0x1)}),_0x52a221===this['activeAnnotation']&&this['setActiveAnnotation'](null);},{'priority':_0x3c2c('0x25')}),this['listenTo'](_0x3a0855,_0x3c2c('0x33'),(_0x177a03,_0x27ce04)=>{this[_0x3c2c('0x5b')](_0x27ce04);}),this[_0x3c2c('0x2e')](_0x3a0855,'blur',()=>{this[_0x3c2c('0x5b')](null);}),this[_0x3c2c('0x4a')]['listenTo'](document,_0x3c2c('0x5a'),(_0x299e87,_0x372ae9)=>{_0x372ae9['keyCode']===_0x490116[_0x3c2c('0xb')]&&_0x27da25['isVisible']&&(this[_0x3c2c('0x4f')]['add'](_0x27da25[_0x3c2c('0x3c')][_0x3c2c('0x42')]),this['_hideBalloon'](),_0x372ae9[_0x3c2c('0x7')](),_0x372ae9['preventDefault']());}),this[_0x3c2c('0x4a')][_0x3c2c('0x2e')](document,_0x3c2c('0x8'),(_0xc9637d,_0x3aa78b)=>{const _0x575c01=_0x3aa78b['target'];_0x27da25[_0x3c2c('0x3d')]&&_0x27da25[_0x3c2c('0x1f')][_0x3c2c('0x2c')](_0x575c01)||_0x2125d9[_0x3c2c('0x1c')][_0x3c2c('0x1f')][_0x3c2c('0x2c')](_0x575c01)||_0xc9637d['preventClosingBalloon']||(this[_0x3c2c('0x4f')][_0x3c2c('0x44')](),this[_0x3c2c('0x30')](),this[_0x3c2c('0x5b')](null));});const _0xa911f9=this[_0x3c2c('0x9')]instanceof _0x482755?this[_0x3c2c('0x9')][_0x3c2c('0x11')]:new _0xa5b00([this[_0x3c2c('0x9')]]);for(const _0x59641c of _0xa911f9)this[_0x3c2c('0x57')](_0x59641c);this[_0x3c2c('0x2e')](_0xa911f9,_0x3c2c('0x6'),(_0x1411b0,_0x483404)=>{this[_0x3c2c('0x2e')](_0x483404,'ready',()=>{this[_0x3c2c('0x57')](_0x483404);});}),this[_0x3c2c('0x2e')](_0xa911f9,_0x3c2c('0x16'),(_0x574e1e,_0x557180)=>{_0x557180[_0x3c2c('0x49')][_0x3c2c('0x4e')]('EditorAnnotations')&&this[_0x3c2c('0x43')](_0x557180[_0x3c2c('0x49')][_0x3c2c('0x18')](_0x3c2c('0x4c')));}),window[_0x3c2c('0x58')](_0x3c2c('0x47'),this[_0x3c2c('0xe')]),this[_0x3c2c('0x46')]();}['setActiveAnnotation'](_0x5f1fa4){if(_0x5f1fa4===this['activeAnnotation'])return;const _0x1827f7=this['context'][_0x3c2c('0x49')][_0x3c2c('0x18')](_0x41b3c8);if(_0x1827f7['refresh']({'blurredAnnotation':this[_0x3c2c('0x56')],'activatedAnnotation':_0x5f1fa4,'disableAnimationOnActivatedAnnotation':!0x0}),_0x5f1fa4)_0x1827f7[_0x3c2c('0x53')](_0x5f1fa4)?this[_0x3c2c('0x4')](_0x5f1fa4):this[_0x3c2c('0x30')]();else this['_hideBalloon']();this[_0x3c2c('0x56')]=_0x5f1fa4;}[_0x3c2c('0x2')](){if(!this[_0x3c2c('0x4b')])throw new _0x4759ee('narrowsidebar-detach-not-attached',this);this[_0x3c2c('0x5b')](null);const _0x1cd1f6=this[_0x3c2c('0x9')][_0x3c2c('0x49')][_0x3c2c('0x18')](_0x41b3c8);this['_hideBalloon'](),Array['from'](this[_0x3c2c('0xc')]['values'](),_0x4802f9=>_0x4802f9['destroy']()),this[_0x3c2c('0xc')][_0x3c2c('0x44')](),_0x1cd1f6[_0x3c2c('0x20')](this[_0x3c2c('0x2a')]),this[_0x3c2c('0x31')](),this[_0x3c2c('0x4a')][_0x3c2c('0x31')](),this[_0x3c2c('0x9')]instanceof _0x482755&&this[_0x3c2c('0x31')](this[_0x3c2c('0x9')][_0x3c2c('0x11')]);for(const _0x1d9a97 of Array[_0x3c2c('0x50')](this['_editorAnnotations']))this[_0x3c2c('0x43')](_0x1d9a97);window[_0x3c2c('0x5c')](_0x3c2c('0x47'),this[_0x3c2c('0xe')]),this[_0x3c2c('0xe')][_0x3c2c('0x23')](),this[_0x3c2c('0x37')]=[],this[_0x3c2c('0x4b')]=!0x1,this[_0x3c2c('0x2a')]=null;}[_0x3c2c('0x0')](){this[_0x3c2c('0x4b')]&&this[_0x3c2c('0x2')](),this[_0x3c2c('0x27')][_0x3c2c('0x1d')]();}['_integrateWithEditorAnnotations'](_0x78a930){const _0x3e20c0=_0x78a930[_0x3c2c('0x49')][_0x3c2c('0x18')](_0x5dabdb),_0x53aee6=this['context'][_0x3c2c('0x49')]['get'](_0x41b3c8),_0x22511a=this[_0x3c2c('0x2a')],_0x1ae84a=this['balloonPanelView'],_0x425783=()=>{const _0x50354a=_0x3e20c0['getOrderedSelectedAnnotations']({'annotations':this[_0x3c2c('0x2a')],'activeAnnotation':this[_0x3c2c('0x56')]});this[_0x3c2c('0x36')](_0x50354a),this[_0x3c2c('0x5b')](_0x50354a[0x0]||null);};this['listenTo'](_0x3e20c0,'refresh',_0x425783),this['listenTo'](_0x3e20c0,'blur',(_0x511d56,{isAnnotationTracked:_0x3e8ef2})=>{this[_0x3c2c('0x56')]&&_0x3e8ef2(this[_0x3c2c('0x56')])&&(this['_setSelectedAnnotations']([]),this[_0x3c2c('0x5b')](null));}),this['listenTo'](_0x3e20c0,_0x3c2c('0x59'),()=>{this[_0x3c2c('0xe')]();}),this[_0x3c2c('0x2e')](_0x22511a,_0x3c2c('0x1b'),_0x17e3d6=>{_0x3e20c0['hasDomSelection']()&&_0x17e3d6[_0x3c2c('0x2f')]();},{'priority':_0x3c2c('0x55')}),this[_0x3c2c('0x2e')](this[_0x3c2c('0x4a')],_0x3c2c('0x8'),(_0x14055a,_0x250bed)=>{const _0x3acb71=_0x250bed['target'];_0x1ae84a[_0x3c2c('0x3d')]&&_0x1ae84a[_0x3c2c('0x1f')][_0x3c2c('0x2c')](_0x3acb71)||_0x53aee6[_0x3c2c('0x1c')][_0x3c2c('0x1f')][_0x3c2c('0x2c')](_0x3acb71)||this['activeAnnotation']&&_0x3e20c0[_0x3c2c('0x35')]()&&(_0x425783(),_0x14055a[_0x3c2c('0x24')]=!0x0);},{'priority':_0x3c2c('0x55')}),this[_0x3c2c('0x32')]['add'](_0x3e20c0);}[_0x3c2c('0x43')](_0x3c226d){_0x3c226d&&(this[_0x3c2c('0x31')](_0x3c226d),this['_editorAnnotations'][_0x3c2c('0x16')](_0x3c226d));}[_0x3c2c('0x36')](_0x348ff8){for(const _0x25f0d1 of this[_0x3c2c('0x37')])_0x348ff8[_0x3c2c('0x34')](_0x25f0d1)||this['_manuallyClosedAnnotationViews'][_0x3c2c('0x45')](_0x25f0d1[_0x3c2c('0x1c')]);this[_0x3c2c('0x37')]=_0x348ff8;}['_refreshPositioning'](){const _0x45f2f6=this[_0x3c2c('0x17')];this[_0x3c2c('0x2a')][_0x3c2c('0x14')](),_0x45f2f6[_0x3c2c('0x3d')]&&this['_updateBalloonPosition']();}[_0x3c2c('0x4')](_0x500efd){if(this[_0x3c2c('0x4f')]['has'](_0x500efd['view']))return;const _0x12b896=this[_0x3c2c('0x17')][_0x3c2c('0x3c')][_0x3c2c('0x42')];_0x12b896!==_0x500efd[_0x3c2c('0x1c')]?(_0x12b896&&this[_0x3c2c('0xf')](_0x12b896),this[_0x3c2c('0x3')](_0x500efd[_0x3c2c('0x1c')]),this[_0x3c2c('0x17')]['content'][_0x3c2c('0x44')](),this['balloonPanelView'][_0x3c2c('0x3c')][_0x3c2c('0x6')](_0x500efd[_0x3c2c('0x1c')]),this[_0x3c2c('0x1e')]()):this[_0x3c2c('0x1e')]();}[_0x3c2c('0x1e')](){const _0x37ab37=this[_0x3c2c('0x17')][_0x3c2c('0x3c')][_0x3c2c('0x42')],_0x3d8535=_0x37ab37&&this['annotations'][_0x3c2c('0x15')](_0x37ab37);if(!_0x3d8535||!this[_0x3c2c('0xc')]['has'](_0x3d8535))return;const _0x1ddc15=this[_0x3c2c('0xc')][_0x3c2c('0x18')](_0x3d8535)[_0x3c2c('0x1f')],_0x54340b=function(){const _0x44d0e6=_0x2a46fc[_0x3c2c('0x41')];return[_0x44d0e6['southArrowNorthEast'],_0x44d0e6[_0x3c2c('0x12')],_0x44d0e6[_0x3c2c('0x4d')],_0x44d0e6['northArrowSouth'],_0x44d0e6[_0x3c2c('0x13')],_0x44d0e6[_0x3c2c('0xd')]];}();this[_0x3c2c('0x17')][_0x3c2c('0x40')]({'target':_0x1ddc15,'positions':_0x54340b});}['_hideBalloon'](){const _0x579779=this['balloonPanelView'],_0x2e9c1e=_0x579779[_0x3c2c('0x3c')][_0x3c2c('0x42')];_0x2e9c1e&&(this[_0x3c2c('0xf')](_0x2e9c1e),_0x579779[_0x3c2c('0x54')](),_0x579779[_0x3c2c('0x3c')][_0x3c2c('0x44')]());}[_0x3c2c('0x3')](_0x2b150a){this[_0x3c2c('0x2e')](_0x2b150a,_0x3c2c('0x26'),()=>this['_updateBalloonPosition']()),this['listenTo'](_0x2b150a,_0x3c2c('0x2d'),(_0x2f2e54,_0xf18cae)=>{this[_0x3c2c('0x4f')][_0x3c2c('0x6')](_0x2b150a),this[_0x3c2c('0x30')](),_0xf18cae();});}['_detachListeners'](_0x3f76ae){this[_0x3c2c('0x31')](_0x3f76ae);}}
|
|
23
|
+
const _0x4bdf=['_editorAnnotations','getByView','_hideBalloon','_integrateWithEditorAnnotations','listenTo','getOrderedSelectedAnnotations','keydown','view','balloonPanelView','rearrange','content','annotations','from','refreshPositioning','southArrowNorthWest','_domEmitter','ready','_detachFromContainer','add','type','refresh','_showBalloon','remove','annotationType','isAttached','clear','number','values','delete','hasDomSelection','stopListening','northArrowSouthEast','_manuallyClosedAnnotationViews','execute','addEventListener','Esc','requires','keyCode','northArrowSouthWest','set:container','contains','unpin','_setSelectedAnnotations','blur','change:container','southArrowNorth','first','low','isVisible','southArrowNorthEast','detach','defaultPositions','isDirty','northArrowSouth','element','bind','target','get','_annotationToNarrowView','EditorAnnotations','activeAnnotation','register','_destroyEditorAnnotationsIntegration','bodyCollection','high','mousedown','addAnnotation','init','focus','editors','locale','_updateBalloonPosition','set','attach','NarrowSidebar','_detachListeners','_refreshPositioningDebounced','off','_attachListeners','_selectedAnnotations','length','stop','_refreshPositioning','plugins','detachFromDom','narrowSidebar','preventClosingBalloon','context','esc','pin','resize','setActiveAnnotation','removeEventListener','cancel','stopPropagation','has','destroy'];(function(_0x625103,_0x4bdfab){const _0x2af638=function(_0x1d0cbb){while(--_0x1d0cbb){_0x625103['push'](_0x625103['shift']());}};_0x2af638(++_0x4bdfab);}(_0x4bdf,0x7d));const _0x2af6=function(_0x625103,_0x4bdfab){_0x625103=_0x625103-0x0;let _0x2af638=_0x4bdf[_0x625103];return _0x2af638;};import{ContextPlugin as _0x13cc88,Context as _0x5e950c}from'ckeditor5/src/core';import _0x102ee3 from'./annotationsuis';import _0x50b4bf from'./sidebar';import _0x52e1a2 from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x29e017,BodyCollection as _0x281ec5}from'ckeditor5/src/ui';import{CKEditorError as _0x1b69fc,DomEmitterMixin as _0x180125,keyCodes as _0x2dca77,Collection as _0x3342ee}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x9fd33b}from'lodash-es';import _0x2ce106 from'./editorannotations';export default class s extends _0x13cc88{static get[_0x2af6('0x8')](){return[_0x50b4bf,_0x102ee3];}static get['pluginName'](){return _0x2af6('0x2e');}constructor(_0x3e48ea){super(_0x3e48ea),this['isAttached']=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this[_0x2af6('0x54')]=Object['create'](_0x180125),this[_0x2af6('0x1e')]=new Map(),this[_0x2af6('0x2c')](_0x2af6('0x20'),null),this[_0x2af6('0x50')]=null,this['_selectedAnnotations']=[],this[_0x2af6('0x45')]=new _0x3342ee(),this['_refreshPositioningDebounced']=_0x9fd33b(()=>{this[_0x2af6('0x36')]();},0xfa,{'leading':!0x1});}[_0x2af6('0x27')](){this['context'][_0x2af6('0x37')][_0x2af6('0x1d')](_0x102ee3)[_0x2af6('0x21')](_0x2af6('0x39'),this),this[_0x2af6('0x23')]=new _0x281ec5(this['context'][_0x2af6('0x2a')]),this[_0x2af6('0x4d')]=new _0x29e017(this['context']['locale']),this[_0x2af6('0x23')]['attachToDom'](),this[_0x2af6('0x23')]['add'](this[_0x2af6('0x4d')]);}[_0x2af6('0x2d')](_0x64fc4c){this[_0x2af6('0x50')]=_0x64fc4c;const _0xbbcc9=this['context'][_0x2af6('0x37')][_0x2af6('0x1d')](_0x50b4bf),_0x439ba3=this[_0x2af6('0x4d')];if(_0xbbcc9['_annotations']=_0x64fc4c,this[_0x2af6('0x5d')])throw new _0x1b69fc('narrowsidebar-attach-already-attached',this);this['isAttached']=!0x0,this[_0x2af6('0x49')](_0xbbcc9,_0x2af6('0xb'),()=>{this[_0x2af6('0x16')](),this[_0x2af6('0x49')](_0xbbcc9,_0x2af6('0x10'),_0x195d30=>{_0x195d30[_0x2af6('0x31')](),this['attach'](_0x64fc4c);});}),_0xbbcc9['_attachToContainer']({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x593c73=_0x44f523=>{const _0x6be0a5=new _0x52e1a2(this[_0x2af6('0x3b')][_0x2af6('0x2a')]);_0xbbcc9[_0x2af6('0x26')](_0x44f523,_0x6be0a5),this['_annotationToNarrowView'][_0x2af6('0x2c')](_0x44f523,_0x6be0a5),_0x6be0a5[_0x2af6('0x1b')](_0x2af6('0x18'),_0x2af6('0x5c'),_0x2af6('0x5f'))['to'](_0x44f523['view'],_0x2af6('0x18'),_0x2af6('0x58'),_0x2af6('0x34')),_0x6be0a5['on'](_0x2af6('0x5'),()=>{this[_0x2af6('0x4')][_0x2af6('0x5e')](),_0x439ba3[_0x2af6('0x4f')][_0x2af6('0x12')]!==_0x44f523[_0x2af6('0x4c')]?(this[_0x2af6('0x5a')](_0x44f523),_0x44f523[_0x2af6('0x4c')][_0x2af6('0x1a')][_0x2af6('0x28')](),this[_0x2af6('0x3f')](_0x44f523)):this[_0x2af6('0x3f')](null);});};for(const _0xf6d57e of _0x64fc4c)_0x593c73(_0xf6d57e);this[_0x2af6('0x49')](_0x64fc4c,_0x2af6('0x57'),(_0x19d488,_0x548482)=>{_0x593c73(_0x548482);}),this['listenTo'](_0x64fc4c,_0x2af6('0x5b'),(_0x5c07bc,_0x537a44,_0x4507b0)=>{this[_0x2af6('0x1e')][_0x2af6('0x1d')](_0x537a44)['destroy'](),this[_0x2af6('0x1e')][_0x2af6('0x0')](_0x537a44),_0xbbcc9[_0x2af6('0x4e')]({'removedAnnotation':_0x537a44,'previousAnnotation':_0x64fc4c[_0x2af6('0x1d')](_0x4507b0-0x1),'nextAnnotation':_0x64fc4c[_0x2af6('0x1d')](_0x4507b0+0x1)}),_0x537a44===this['activeAnnotation']&&this[_0x2af6('0x3f')](null);},{'priority':_0x2af6('0x13')}),this['listenTo'](_0x64fc4c,_0x2af6('0x28'),(_0x2a2c64,_0x207f12)=>{this[_0x2af6('0x3f')](_0x207f12);}),this[_0x2af6('0x49')](_0x64fc4c,_0x2af6('0xf'),()=>{this[_0x2af6('0x3f')](null);}),this['_domEmitter'][_0x2af6('0x49')](document,_0x2af6('0x4b'),(_0x465c96,_0x216f3e)=>{_0x216f3e[_0x2af6('0x9')]===_0x2dca77[_0x2af6('0x3c')]&&_0x439ba3['isVisible']&&(this[_0x2af6('0x4')][_0x2af6('0x57')](_0x439ba3[_0x2af6('0x4f')][_0x2af6('0x12')]),this[_0x2af6('0x47')](),_0x216f3e[_0x2af6('0x42')](),_0x216f3e['preventDefault']());}),this[_0x2af6('0x54')][_0x2af6('0x49')](document,_0x2af6('0x25'),(_0x407bae,_0x38505b)=>{const _0x5835f4=_0x38505b[_0x2af6('0x1c')];_0x439ba3[_0x2af6('0x14')]&&_0x439ba3['element'][_0x2af6('0xc')](_0x5835f4)||_0xbbcc9['view']['element'][_0x2af6('0xc')](_0x5835f4)||_0x407bae[_0x2af6('0x3a')]||(this[_0x2af6('0x4')][_0x2af6('0x5e')](),this[_0x2af6('0x47')](),this[_0x2af6('0x3f')](null));});const _0x35fd24=this['context']instanceof _0x5e950c?this['context'][_0x2af6('0x29')]:new _0x3342ee([this[_0x2af6('0x3b')]]);for(const _0x3ec005 of _0x35fd24)this[_0x2af6('0x48')](_0x3ec005);this[_0x2af6('0x49')](_0x35fd24,_0x2af6('0x57'),(_0x28a075,_0x50f6d6)=>{this[_0x2af6('0x49')](_0x50f6d6,_0x2af6('0x55'),()=>{this['_integrateWithEditorAnnotations'](_0x50f6d6);});}),this['listenTo'](_0x35fd24,'remove',(_0x2a9cb7,_0x3ead03)=>{_0x3ead03['plugins'][_0x2af6('0x43')](_0x2af6('0x1f'))&&this[_0x2af6('0x22')](_0x3ead03['plugins']['get'](_0x2af6('0x1f')));}),window[_0x2af6('0x6')]('resize',this[_0x2af6('0x30')]),this[_0x2af6('0x36')]();}[_0x2af6('0x3f')](_0x1b7bf3){if(_0x1b7bf3===this[_0x2af6('0x20')])return;const _0x2d421d=this[_0x2af6('0x3b')][_0x2af6('0x37')][_0x2af6('0x1d')](_0x50b4bf);if(_0x2d421d[_0x2af6('0x59')]({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x1b7bf3,'disableAnimationOnActivatedAnnotation':!0x0}),_0x1b7bf3)_0x2d421d['getSidebarItemView'](_0x1b7bf3)?this['_showBalloon'](_0x1b7bf3):this[_0x2af6('0x47')]();else this['_hideBalloon']();this[_0x2af6('0x20')]=_0x1b7bf3;}['detach'](){if(!this[_0x2af6('0x5d')])throw new _0x1b69fc('narrowsidebar-detach-not-attached',this);this[_0x2af6('0x3f')](null);const _0x439919=this[_0x2af6('0x3b')][_0x2af6('0x37')][_0x2af6('0x1d')](_0x50b4bf);this[_0x2af6('0x47')](),Array[_0x2af6('0x51')](this['_annotationToNarrowView'][_0x2af6('0x60')](),_0x9aee6f=>_0x9aee6f[_0x2af6('0x44')]()),this[_0x2af6('0x1e')][_0x2af6('0x5e')](),_0x439919[_0x2af6('0x56')](this[_0x2af6('0x50')]),this['stopListening'](),this['_domEmitter'][_0x2af6('0x2')](),this[_0x2af6('0x3b')]instanceof _0x5e950c&&this['stopListening'](this['context'][_0x2af6('0x29')]);for(const _0x294e5b of Array[_0x2af6('0x51')](this[_0x2af6('0x45')]))this[_0x2af6('0x22')](_0x294e5b);window[_0x2af6('0x40')](_0x2af6('0x3e'),this[_0x2af6('0x30')]),this[_0x2af6('0x30')][_0x2af6('0x41')](),this[_0x2af6('0x33')]=[],this[_0x2af6('0x5d')]=!0x1,this[_0x2af6('0x50')]=null;}[_0x2af6('0x44')](){this['isAttached']&&this[_0x2af6('0x16')](),this[_0x2af6('0x23')][_0x2af6('0x38')]();}['_integrateWithEditorAnnotations'](_0x4195fd){const _0x4c3fb9=_0x4195fd[_0x2af6('0x37')][_0x2af6('0x1d')](_0x2ce106),_0x445da8=this[_0x2af6('0x3b')][_0x2af6('0x37')]['get'](_0x50b4bf),_0x1b32b5=this[_0x2af6('0x50')],_0x3f0421=this['balloonPanelView'],_0x587368=()=>{const _0x159807=_0x4c3fb9[_0x2af6('0x4a')]({'annotations':this[_0x2af6('0x50')],'activeAnnotation':this['activeAnnotation']});this[_0x2af6('0xe')](_0x159807),this[_0x2af6('0x3f')](_0x159807[0x0]||null);};this[_0x2af6('0x49')](_0x4c3fb9,'refresh',_0x587368),this[_0x2af6('0x49')](_0x4c3fb9,_0x2af6('0xf'),(_0x4c59a0,{isAnnotationTracked:_0x47dc52})=>{this['activeAnnotation']&&_0x47dc52(this['activeAnnotation'])&&(this[_0x2af6('0xe')]([]),this[_0x2af6('0x3f')](null));}),this['listenTo'](_0x4c3fb9,'uiUpdate',()=>{this[_0x2af6('0x30')]();}),this[_0x2af6('0x49')](_0x1b32b5,_0x2af6('0xf'),_0x1f9cce=>{_0x4c3fb9[_0x2af6('0x1')]()&&_0x1f9cce[_0x2af6('0x35')]();},{'priority':_0x2af6('0x24')}),this[_0x2af6('0x49')](this[_0x2af6('0x54')],_0x2af6('0x25'),(_0x163cc5,_0x31781f)=>{const _0x1260f9=_0x31781f[_0x2af6('0x1c')];_0x3f0421[_0x2af6('0x14')]&&_0x3f0421['element'][_0x2af6('0xc')](_0x1260f9)||_0x445da8[_0x2af6('0x4c')]['element'][_0x2af6('0xc')](_0x1260f9)||this[_0x2af6('0x20')]&&_0x4c3fb9[_0x2af6('0x1')]()&&(_0x587368(),_0x163cc5['preventClosingBalloon']=!0x0);},{'priority':_0x2af6('0x24')}),this['_editorAnnotations'][_0x2af6('0x57')](_0x4c3fb9);}[_0x2af6('0x22')](_0x759842){_0x759842&&(this[_0x2af6('0x2')](_0x759842),this[_0x2af6('0x45')]['remove'](_0x759842));}[_0x2af6('0xe')](_0xc87d7){for(const _0x327b05 of this[_0x2af6('0x33')])_0xc87d7['includes'](_0x327b05)||this[_0x2af6('0x4')][_0x2af6('0x0')](_0x327b05[_0x2af6('0x4c')]);this[_0x2af6('0x33')]=_0xc87d7;}[_0x2af6('0x36')](){const _0x34b05b=this['balloonPanelView'];this[_0x2af6('0x50')][_0x2af6('0x52')](),_0x34b05b[_0x2af6('0x14')]&&this['_updateBalloonPosition']();}[_0x2af6('0x5a')](_0x346936){if(this[_0x2af6('0x4')][_0x2af6('0x43')](_0x346936['view']))return;const _0x1c165a=this[_0x2af6('0x4d')][_0x2af6('0x4f')][_0x2af6('0x12')];_0x1c165a!==_0x346936[_0x2af6('0x4c')]?(_0x1c165a&&this[_0x2af6('0x2f')](_0x1c165a),this[_0x2af6('0x32')](_0x346936[_0x2af6('0x4c')]),this[_0x2af6('0x4d')][_0x2af6('0x4f')][_0x2af6('0x5e')](),this[_0x2af6('0x4d')][_0x2af6('0x4f')][_0x2af6('0x57')](_0x346936['view']),this[_0x2af6('0x2b')]()):this['_updateBalloonPosition']();}[_0x2af6('0x2b')](){const _0x3c1b6e=this['balloonPanelView'][_0x2af6('0x4f')][_0x2af6('0x12')],_0x483869=_0x3c1b6e&&this[_0x2af6('0x50')][_0x2af6('0x46')](_0x3c1b6e);if(!_0x483869||!this[_0x2af6('0x1e')][_0x2af6('0x43')](_0x483869))return;const _0x32078a=this[_0x2af6('0x1e')]['get'](_0x483869)['element'],_0x4fb68b=function(){const _0x1467f2=_0x29e017[_0x2af6('0x17')];return[_0x1467f2[_0x2af6('0x15')],_0x1467f2[_0x2af6('0x3')],_0x1467f2[_0x2af6('0x11')],_0x1467f2[_0x2af6('0x19')],_0x1467f2[_0x2af6('0x53')],_0x1467f2[_0x2af6('0xa')]];}();this[_0x2af6('0x4d')][_0x2af6('0x3d')]({'target':_0x32078a,'positions':_0x4fb68b});}[_0x2af6('0x47')](){const _0xebcd79=this[_0x2af6('0x4d')],_0x3df7a6=_0xebcd79['content'][_0x2af6('0x12')];_0x3df7a6&&(this[_0x2af6('0x2f')](_0x3df7a6),_0xebcd79[_0x2af6('0xd')](),_0xebcd79[_0x2af6('0x4f')][_0x2af6('0x5e')]());}['_attachListeners'](_0x5d46d4){this['listenTo'](_0x5d46d4,'change:height',()=>this[_0x2af6('0x2b')]()),this['listenTo'](_0x5d46d4,_0x2af6('0x7'),(_0x36cf51,_0x1d5670)=>{this['_manuallyClosedAnnotationViews'][_0x2af6('0x57')](_0x5d46d4),this[_0x2af6('0x47')](),_0x1d5670();});}[_0x2af6('0x2f')](_0x550dd7){this['stopListening'](_0x550dd7);}}
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/annotations/sidebar
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
|
|
6
|
-
import type { View } from 'ckeditor5/src/ui';
|
|
7
|
-
import SidebarView from './view/sidebarview';
|
|
8
|
-
import SidebarItemView from './view/sidebaritemview';
|
|
9
|
-
import type Annotation from './annotation';
|
|
10
|
-
/**
|
|
11
|
-
* Displays {@link module:comments/annotations/annotationcollection~AnnotationCollection annotations} inside a sidebar.
|
|
12
|
-
*
|
|
13
|
-
* `Sidebar` provides a {@link module:comments/annotations/view/sidebarview~SidebarView} which can be injected at any place on a website.
|
|
14
|
-
*
|
|
15
|
-
* It's main role is to display and correctly position annotation views added to the sidebar, accordingly to their target elements
|
|
16
|
-
* or `Rect`s.
|
|
17
|
-
*
|
|
18
|
-
* The following plugins use `Sidebar` to provide annotations UI:
|
|
19
|
-
*
|
|
20
|
-
* * {@link module:comments/annotations/widesidebar~WideSidebar}
|
|
21
|
-
* * {@link module:comments/annotations/narrowsidebar~NarrowSidebar}
|
|
22
|
-
*
|
|
23
|
-
* The sidebar plugin introduces {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} which is a wrapper view for
|
|
24
|
-
* {@link module:comments/annotations/view/annotationview~AnnotationView}. It adds an interface needed for positioning views inside
|
|
25
|
-
* the sidebar.
|
|
26
|
-
*
|
|
27
|
-
* Structure of items:
|
|
28
|
-
*
|
|
29
|
-
* |-> SidebarItemView -> AnnotationView -> added View
|
|
30
|
-
* Sidebar#view#list -|-> SidebarItemView -> AnnotationView -> added View
|
|
31
|
-
* |-> ...
|
|
32
|
-
*/
|
|
33
|
-
export default class Sidebar extends ContextPlugin {
|
|
34
|
-
/**
|
|
35
|
-
* Container element into which sidebar is injected (in the DOM).
|
|
36
|
-
*
|
|
37
|
-
* @observable
|
|
38
|
-
*/
|
|
39
|
-
container: HTMLElement | null;
|
|
40
|
-
/**
|
|
41
|
-
* Sidebar view.
|
|
42
|
-
*/
|
|
43
|
-
view: SidebarView;
|
|
44
|
-
/**
|
|
45
|
-
* @inheritDoc
|
|
46
|
-
*/
|
|
47
|
-
static get pluginName():
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
constructor(context: Context | Editor);
|
|
52
|
-
/**
|
|
53
|
-
* @inheritDoc
|
|
54
|
-
*/
|
|
55
|
-
init(): void;
|
|
56
|
-
/**
|
|
57
|
-
* Sets a new sidebar container.
|
|
58
|
-
*/
|
|
59
|
-
setContainer(container: HTMLElement): void;
|
|
60
|
-
/**
|
|
61
|
-
* Rearranges annotations when the annotation is removed.
|
|
62
|
-
*/
|
|
63
|
-
rearrange({ removedAnnotation, previousAnnotation, nextAnnotation }: {
|
|
64
|
-
removedAnnotation: Annotation;
|
|
65
|
-
previousAnnotation: Annotation | null;
|
|
66
|
-
nextAnnotation: Annotation | null;
|
|
67
|
-
}): void;
|
|
68
|
-
/**
|
|
69
|
-
* Refreshes sidebar items when one of the annotations is activated.
|
|
70
|
-
*
|
|
71
|
-
* @param options.activatedAnnotation The activated annotation.
|
|
72
|
-
* @param options.blurredAnnotation The previously active annotation.
|
|
73
|
-
* @param options.disableAnimationOnActivatedAnnotation Disables animation on the activated annotation.
|
|
74
|
-
*/
|
|
75
|
-
refresh({ blurredAnnotation, activatedAnnotation, disableAnimationOnActivatedAnnotation }: {
|
|
76
|
-
blurredAnnotation: Annotation | null;
|
|
77
|
-
activatedAnnotation: Annotation | null;
|
|
78
|
-
disableAnimationOnActivatedAnnotation?: boolean;
|
|
79
|
-
}): void;
|
|
80
|
-
/**
|
|
81
|
-
* Creates new {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} and binds its
|
|
82
|
-
* position with {@link module:comments/annotations/view/annotationview~AnnotationView} target position.
|
|
83
|
-
*
|
|
84
|
-
* By default, annotation's view will be displayed in the sidebar. However, you can provide any other view
|
|
85
|
-
* to be displayed instead using `annotationToDisplay`. `annotation` will be then used only to gather data needed by `Sidebar`.
|
|
86
|
-
*/
|
|
87
|
-
addAnnotation(annotation: Annotation, viewToDisplay?: View): SidebarItemView;
|
|
88
|
-
/**
|
|
89
|
-
* Returns sidebar item view that wraps given annotation view.
|
|
90
|
-
*/
|
|
91
|
-
getSidebarItemView(annotation: Annotation): SidebarItemView | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* @inheritDoc
|
|
94
|
-
*/
|
|
95
|
-
destroy(): void;
|
|
96
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/sidebar
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
|
|
6
|
+
import type { View } from 'ckeditor5/src/ui';
|
|
7
|
+
import SidebarView from './view/sidebarview';
|
|
8
|
+
import SidebarItemView from './view/sidebaritemview';
|
|
9
|
+
import type Annotation from './annotation';
|
|
10
|
+
/**
|
|
11
|
+
* Displays {@link module:comments/annotations/annotationcollection~AnnotationCollection annotations} inside a sidebar.
|
|
12
|
+
*
|
|
13
|
+
* `Sidebar` provides a {@link module:comments/annotations/view/sidebarview~SidebarView} which can be injected at any place on a website.
|
|
14
|
+
*
|
|
15
|
+
* It's main role is to display and correctly position annotation views added to the sidebar, accordingly to their target elements
|
|
16
|
+
* or `Rect`s.
|
|
17
|
+
*
|
|
18
|
+
* The following plugins use `Sidebar` to provide annotations UI:
|
|
19
|
+
*
|
|
20
|
+
* * {@link module:comments/annotations/widesidebar~WideSidebar}
|
|
21
|
+
* * {@link module:comments/annotations/narrowsidebar~NarrowSidebar}
|
|
22
|
+
*
|
|
23
|
+
* The sidebar plugin introduces {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} which is a wrapper view for
|
|
24
|
+
* {@link module:comments/annotations/view/annotationview~AnnotationView}. It adds an interface needed for positioning views inside
|
|
25
|
+
* the sidebar.
|
|
26
|
+
*
|
|
27
|
+
* Structure of items:
|
|
28
|
+
*
|
|
29
|
+
* |-> SidebarItemView -> AnnotationView -> added View
|
|
30
|
+
* Sidebar#view#list -|-> SidebarItemView -> AnnotationView -> added View
|
|
31
|
+
* |-> ...
|
|
32
|
+
*/
|
|
33
|
+
export default class Sidebar extends ContextPlugin {
|
|
34
|
+
/**
|
|
35
|
+
* Container element into which sidebar is injected (in the DOM).
|
|
36
|
+
*
|
|
37
|
+
* @observable
|
|
38
|
+
*/
|
|
39
|
+
container: HTMLElement | null;
|
|
40
|
+
/**
|
|
41
|
+
* Sidebar view.
|
|
42
|
+
*/
|
|
43
|
+
view: SidebarView;
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
static get pluginName(): "Sidebar";
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
constructor(context: Context | Editor);
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
init(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Sets a new sidebar container.
|
|
58
|
+
*/
|
|
59
|
+
setContainer(container: HTMLElement): void;
|
|
60
|
+
/**
|
|
61
|
+
* Rearranges annotations when the annotation is removed.
|
|
62
|
+
*/
|
|
63
|
+
rearrange({ removedAnnotation, previousAnnotation, nextAnnotation }: {
|
|
64
|
+
removedAnnotation: Annotation;
|
|
65
|
+
previousAnnotation: Annotation | null;
|
|
66
|
+
nextAnnotation: Annotation | null;
|
|
67
|
+
}): void;
|
|
68
|
+
/**
|
|
69
|
+
* Refreshes sidebar items when one of the annotations is activated.
|
|
70
|
+
*
|
|
71
|
+
* @param options.activatedAnnotation The activated annotation.
|
|
72
|
+
* @param options.blurredAnnotation The previously active annotation.
|
|
73
|
+
* @param options.disableAnimationOnActivatedAnnotation Disables animation on the activated annotation.
|
|
74
|
+
*/
|
|
75
|
+
refresh({ blurredAnnotation, activatedAnnotation, disableAnimationOnActivatedAnnotation }: {
|
|
76
|
+
blurredAnnotation: Annotation | null;
|
|
77
|
+
activatedAnnotation: Annotation | null;
|
|
78
|
+
disableAnimationOnActivatedAnnotation?: boolean;
|
|
79
|
+
}): void;
|
|
80
|
+
/**
|
|
81
|
+
* Creates new {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} and binds its
|
|
82
|
+
* position with {@link module:comments/annotations/view/annotationview~AnnotationView} target position.
|
|
83
|
+
*
|
|
84
|
+
* By default, annotation's view will be displayed in the sidebar. However, you can provide any other view
|
|
85
|
+
* to be displayed instead using `annotationToDisplay`. `annotation` will be then used only to gather data needed by `Sidebar`.
|
|
86
|
+
*/
|
|
87
|
+
addAnnotation(annotation: Annotation, viewToDisplay?: View): SidebarItemView;
|
|
88
|
+
/**
|
|
89
|
+
* Returns sidebar item view that wraps given annotation view.
|
|
90
|
+
*/
|
|
91
|
+
getSidebarItemView(annotation: Annotation): SidebarItemView | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* @inheritDoc
|
|
94
|
+
*/
|
|
95
|
+
destroy(): void;
|
|
96
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x3bab=['bind','getSidebarItemView','view','_recalculate','_attachToContainer','minHeight','_recalculateBuffer','content','add','stopListening','Sidebar','change:_lastItem','_createSidebarView','_destroySidebarItemView','define','bottom','set','_alignForTopChange','_annotations','length','element','_sidebarItemViewToAnnotation','isActive','unbind','listenTo','_lastItem','sidebar.container','_targetTop','_setItemTop','_alignAfterItem','targetRect','getIndex','_alignForBottomChange','top','push','_getTargetTop','_getItemBefore','_annotationToSidebarItemView','_alignBeforeItem','isAnimationDisabled','_getItemAfter','_spaceBetweenItems','context','setContainer','remove','last','get','container','change:targetRect','nodeType','target','list','locale','config','_alignToTargetRect','class','refresh','pluginName','object','sidebar.preventScrollOutOfView','height','destroy','_getMaxAvailableTop','_activeAnnotation','delete','addAnnotation','max','_updateLastItem','updateHeight','appendChild'];(function(_0x14b031,_0x3bab67){const _0x4f9b2d=function(_0x185d62){while(--_0x185d62){_0x14b031['push'](_0x14b031['shift']());}};_0x4f9b2d(++_0x3bab67);}(_0x3bab,0xba));const _0x4f9b=function(_0x14b031,_0x3bab67){_0x14b031=_0x14b031-0x0;let _0x4f9b2d=_0x3bab[_0x14b031];return _0x4f9b2d;};import{ContextPlugin as _0xf8adb8}from'ckeditor5/src/core';import{Rect as _0x1e0c47,CKEditorError as _0x3bc4dc}from'ckeditor5/src/utils';import _0x81af48 from'./view/sidebarview';import _0x20ba33 from'./view/sidebaritemview';export default class z extends _0xf8adb8{static get[_0x4f9b('0xb')](){return _0x4f9b('0x22');}constructor(_0x3d17b5){super(_0x3d17b5),this[_0x4f9b('0x28')](_0x4f9b('0x31'),void 0x0),this[_0x4f9b('0x1a')]=this[_0x4f9b('0x24')](),this['set'](_0x4f9b('0x1'),null),this['_spaceBetweenItems']=0x19,this[_0x4f9b('0x2d')]=new Map(),this[_0x4f9b('0x3d')]=new Map(),this[_0x4f9b('0x42')][_0x4f9b('0x7')][_0x4f9b('0x26')](_0x4f9b('0xd'),!0x1),this[_0x4f9b('0x2a')]=null,this[_0x4f9b('0x11')]=null,this[_0x4f9b('0x1e')]=[];}['init'](){const _0x2643fb=this[_0x4f9b('0x42')][_0x4f9b('0x7')][_0x4f9b('0x0')](_0x4f9b('0x32'));_0x2643fb&&this[_0x4f9b('0x43')](_0x2643fb);}[_0x4f9b('0x43')](_0xbaa845){if(!y(_0xbaa845))throw new _0x3bc4dc('sidebar-setcontainer-invalid-element');this[_0x4f9b('0x1')]=_0xbaa845;}[_0x4f9b('0x1c')]({viewClass:_0x569449='',spaceBetweenItems:_0x436bd4=0x19}={}){if(!y(this['container']))throw new _0x3bc4dc('sidebar-attachtocontainer-missing-container',this);this[_0x4f9b('0x1')][_0x4f9b('0x17')](this[_0x4f9b('0x1a')][_0x4f9b('0x2c')]),this[_0x4f9b('0x1a')][_0x4f9b('0x9')]=_0x569449,this[_0x4f9b('0x41')]=_0x436bd4;}['rearrange']({removedAnnotation:_0x3fab40,previousAnnotation:_0x3cf8b6,nextAnnotation:_0x4a7a40}){const _0x131904=this['getSidebarItemView'](_0x3fab40);this[_0x4f9b('0x1a')][_0x4f9b('0x5')][_0x4f9b('0x44')](_0x131904),this['_destroySidebarItemView'](_0x3fab40),_0x3cf8b6&&this[_0x4f9b('0x8')](this[_0x4f9b('0x19')](_0x3cf8b6)),_0x4a7a40&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x4a7a40)),this['_updateLastItem']();}[_0x4f9b('0xa')]({blurredAnnotation:_0x5148fe,activatedAnnotation:_0x4f1367,disableAnimationOnActivatedAnnotation:_0x315a0d}){if(this[_0x4f9b('0x11')]=_0x4f1367,_0x5148fe){_0x5148fe[_0x4f9b('0x2e')]=!0x1;const _0x2a58f8=this[_0x4f9b('0x19')](_0x5148fe);_0x2a58f8&&_0x315a0d&&(_0x2a58f8['isAnimationDisabled']=!0x1);}if(_0x4f1367){const _0x988d7e=this['getSidebarItemView'](_0x4f1367);_0x988d7e&&(_0x4f1367[_0x4f9b('0x2e')]=!0x0,_0x315a0d&&(_0x988d7e[_0x4f9b('0x3f')]=!0x0,_0x988d7e[_0x4f9b('0x39')]+=0x1),this[_0x4f9b('0x8')](_0x988d7e));}}['_detachFromContainer'](_0xd727db){if(this['stopListening'](),this[_0x4f9b('0x1a')]['element'][_0x4f9b('0x44')](),_0xd727db)for(const _0x362938 of _0xd727db)this['_destroySidebarItemView'](_0x362938);this[_0x4f9b('0x1a')][_0x4f9b('0x5')]['clear'](),this[_0x4f9b('0x1a')][_0x4f9b('0x9')]='',this['_lastItem']=null;}[_0x4f9b('0x13')](_0x1b1943,_0xe4f9f3){_0xe4f9f3||(_0xe4f9f3=_0x1b1943[_0x4f9b('0x1a')]);const _0x43dcf5=new _0x20ba33(this[_0x4f9b('0x42')][_0x4f9b('0x6')]);this['_sidebarItemViewToAnnotation'][_0x4f9b('0x28')](_0x43dcf5,_0x1b1943),this[_0x4f9b('0x3d')][_0x4f9b('0x28')](_0x1b1943,_0x43dcf5),_0x43dcf5[_0x4f9b('0x1f')][_0x4f9b('0x20')](_0xe4f9f3),this['listenTo'](_0x1b1943[_0x4f9b('0x1a')],_0x4f9b('0x2'),(_0xe4ecf4,_0x30b392,_0xe3f31d)=>{const _0x1a5180=this[_0x4f9b('0x3b')](_0x1b1943,_0xe3f31d);_0x43dcf5[_0x4f9b('0x33')]!=_0x1a5180&&(_0x43dcf5[_0x4f9b('0x33')]=_0x1a5180,this[_0x4f9b('0x34')](_0x43dcf5,_0x1a5180));}),this[_0x4f9b('0x30')](_0x43dcf5,'change:top',()=>{this['_recalculate'](_0x43dcf5,'top');}),this[_0x4f9b('0x30')](_0x43dcf5,'change:bottom',()=>{this[_0x4f9b('0x1b')](_0x43dcf5,_0x4f9b('0x27'));}),this[_0x4f9b('0x8')](_0x43dcf5);const _0x21a962=this['_getItemBefore'](_0x43dcf5);if(_0x21a962)this[_0x4f9b('0x35')](_0x21a962,_0x43dcf5)||this[_0x4f9b('0x8')](_0x43dcf5);else this['_alignToTargetRect'](_0x43dcf5);return this[_0x4f9b('0x15')](),this['view'][_0x4f9b('0x5')]['add'](_0x43dcf5),_0x43dcf5;}[_0x4f9b('0x29')](_0x45981e){if(!_0x45981e[_0x4f9b('0x1f')][_0x4f9b('0x2b')])return;const _0x4e4875=this['_getItemBefore'](_0x45981e);if(!_0x4e4875)return;const _0x4dc6eb=this[_0x4f9b('0x2d')]['get'](_0x4e4875),_0x185ada=this[_0x4f9b('0x11')];_0x185ada&&_0x185ada===_0x4dc6eb?this[_0x4f9b('0x35')](_0x4e4875,_0x45981e):this[_0x4f9b('0x3e')](_0x45981e,_0x4e4875);}['_alignForBottomChange'](_0x476b19){if(!_0x476b19[_0x4f9b('0x1f')][_0x4f9b('0x2b')])return;const _0xba35d5=this[_0x4f9b('0x40')](_0x476b19);if(!_0xba35d5)return;const _0x4ec154=this[_0x4f9b('0x2d')][_0x4f9b('0x0')](_0xba35d5),_0x3d0768=this['context'][_0x4f9b('0x7')][_0x4f9b('0x0')](_0x4f9b('0xd')),_0x3595ca=this[_0x4f9b('0x11')];_0x3595ca&&_0x3595ca===_0x4ec154&&_0x3d0768?(this[_0x4f9b('0x3e')](_0xba35d5,_0x476b19),this[_0x4f9b('0x35')](_0x476b19,_0xba35d5)):_0x3595ca&&_0x3595ca===_0x4ec154?this['_alignBeforeItem'](_0xba35d5,_0x476b19):this[_0x4f9b('0x35')](_0x476b19,_0xba35d5);}[_0x4f9b('0x1b')](_0x5d5537,_0x3354d2){0x0===this[_0x4f9b('0x1e')]['length']&&setTimeout(()=>{for(const {sidebarItemView:_0xc5741b,changedProp:_0x5156d1}of this['_recalculateBuffer'])_0x4f9b('0x39')===_0x5156d1?this[_0x4f9b('0x29')](_0xc5741b):this[_0x4f9b('0x38')](_0xc5741b);this[_0x4f9b('0x1e')]=[];},0xa),this['_recalculateBuffer'][_0x4f9b('0x3a')]({'sidebarItemView':_0x5d5537,'changedProp':_0x3354d2});}[_0x4f9b('0x19')](_0x3bc564){return this[_0x4f9b('0x3d')][_0x4f9b('0x0')](_0x3bc564);}[_0x4f9b('0xf')](){this[_0x4f9b('0x1a')]['destroy']();}[_0x4f9b('0x25')](_0x50a8da){const _0x4b67a8=this[_0x4f9b('0x19')](_0x50a8da);this[_0x4f9b('0x21')](_0x4b67a8),this[_0x4f9b('0x21')](_0x50a8da[_0x4f9b('0x1a')]),_0x4b67a8[_0x4f9b('0xf')](),this[_0x4f9b('0x3d')][_0x4f9b('0x12')](_0x50a8da),this['_sidebarItemViewToAnnotation'][_0x4f9b('0x12')](_0x4b67a8);}['_createSidebarView'](){const _0x3f1134=new _0x81af48(this[_0x4f9b('0x42')][_0x4f9b('0x6')]);return _0x3f1134['render'](),this['on'](_0x4f9b('0x23'),(_0x32bc99,_0x3ac888,_0x3f7755,_0x40458c)=>{_0x40458c&&_0x3f1134[_0x4f9b('0x2f')](_0x4f9b('0x1d')),_0x3f7755?_0x3f1134[_0x4f9b('0x18')](_0x4f9b('0x1d'))['to'](_0x3f7755,'bottom'):_0x3f1134[_0x4f9b('0x1d')]=null;}),_0x3f1134;}[_0x4f9b('0x15')](){var _0x762803;this[_0x4f9b('0x31')]=(null===(_0x762803=this['_annotations'])||void 0x0===_0x762803?void 0x0:_0x762803[_0x4f9b('0x45')])?this[_0x4f9b('0x19')](this[_0x4f9b('0x2a')][_0x4f9b('0x45')]):null;}[_0x4f9b('0x3c')](_0x7c7af6){var _0x4d8ad9;const _0x6ccdda=this[_0x4f9b('0x2d')][_0x4f9b('0x0')](_0x7c7af6),_0x21ede9=_0x6ccdda&&(null===(_0x4d8ad9=this['_annotations'])||void 0x0===_0x4d8ad9?void 0x0:_0x4d8ad9['get'](this[_0x4f9b('0x2a')]['getIndex'](_0x6ccdda)-0x1));return _0x21ede9&&this['getSidebarItemView'](_0x21ede9)||null;}[_0x4f9b('0x40')](_0x3dabcf){var _0x1a5937;const _0x1fbf48=this[_0x4f9b('0x2d')][_0x4f9b('0x0')](_0x3dabcf),_0x3b4312=_0x1fbf48&&(null===(_0x1a5937=this['_annotations'])||void 0x0===_0x1a5937?void 0x0:_0x1a5937[_0x4f9b('0x0')](this[_0x4f9b('0x2a')][_0x4f9b('0x37')](_0x1fbf48)+0x1));return _0x3b4312&&this[_0x4f9b('0x19')](_0x3b4312)||null;}['_alignBeforeItem'](_0x1e03c8,_0xadc272){_0x1e03c8['updateHeight']();const _0x142354=H(_0xadc272[_0x4f9b('0x27')]+this[_0x4f9b('0x41')],_0x1e03c8['top']);return!!_0x142354&&(this[_0x4f9b('0x34')](_0xadc272,_0xadc272['top']-_0x142354),!0x0);}[_0x4f9b('0x35')](_0x559f5e,_0x38b176){_0x559f5e[_0x4f9b('0x16')]();const _0x19b3a4=H(_0x559f5e[_0x4f9b('0x27')]+this[_0x4f9b('0x41')],_0x38b176['top']);return!!_0x19b3a4&&(this[_0x4f9b('0x34')](_0x38b176,_0x38b176[_0x4f9b('0x39')]+_0x19b3a4,!0x1),!0x0);}[_0x4f9b('0x8')](_0x7a6feb){const _0x3ec344=this['_sidebarItemViewToAnnotation'][_0x4f9b('0x0')](_0x7a6feb);if(!_0x3ec344||!_0x3ec344[_0x4f9b('0x4')]||!_0x3ec344[_0x4f9b('0x36')])return;const _0x5e5ffe=this['_getTargetTop'](_0x3ec344,_0x3ec344[_0x4f9b('0x36')]);this['_setItemTop'](_0x7a6feb,_0x5e5ffe);}['_getTargetTop'](_0x5d2a34,_0x58b338){if(null===_0x58b338)return 0x0;if(_0x5d2a34[_0x4f9b('0x4')]instanceof _0x1e0c47)return _0x58b338['top'];{const _0x5c4ea6=new _0x1e0c47(this[_0x4f9b('0x1a')][_0x4f9b('0x2c')])[_0x4f9b('0x39')];return _0x58b338[_0x4f9b('0x39')]-_0x5c4ea6;}}[_0x4f9b('0x34')](_0x3a69b0,_0xcb0f71,_0x3f3a31=this[_0x4f9b('0x42')][_0x4f9b('0x7')][_0x4f9b('0x0')]('sidebar.preventScrollOutOfView')){_0x3f3a31&&(_0xcb0f71=Math[_0x4f9b('0x14')](_0xcb0f71,this[_0x4f9b('0x10')](_0x3a69b0))),_0x3a69b0[_0x4f9b('0x39')]=_0xcb0f71;}['_getMaxAvailableTop'](_0x37c800){let _0x5ccb58=this['_getItemBefore'](_0x37c800),_0x1fb74c=0x0;for(;_0x5ccb58;)_0x5ccb58[_0x4f9b('0x16')](),_0x1fb74c+=this[_0x4f9b('0x41')]+_0x5ccb58[_0x4f9b('0xe')],_0x5ccb58=this[_0x4f9b('0x3c')](_0x5ccb58);return _0x1fb74c;}}function H(_0x2ed72c,_0x52fe30){return Math[_0x4f9b('0x14')](_0x2ed72c-_0x52fe30,0x0);}function y(_0x5c29a8){return null!==_0x5c29a8&&_0x4f9b('0xc')==typeof _0x5c29a8&&0x1===_0x5c29a8[_0x4f9b('0x3')];}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/annotations/view/annotationcounterbuttonview
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { ButtonView, View } from 'ckeditor5/src/ui';
|
|
6
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
7
|
-
/**
|
|
8
|
-
* A view used in the sidebar by {@link module:comments/annotations/narrowsidebar~NarrowSidebar}.
|
|
9
|
-
*/
|
|
10
|
-
export default class AnnotationCounterButtonView extends ButtonView {
|
|
11
|
-
/**
|
|
12
|
-
* @observable
|
|
13
|
-
*/
|
|
14
|
-
isDirty: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* @observable
|
|
17
|
-
*/
|
|
18
|
-
number: number;
|
|
19
|
-
/**
|
|
20
|
-
* @observable
|
|
21
|
-
*/
|
|
22
|
-
annotationType: string;
|
|
23
|
-
counterView: View;
|
|
24
|
-
constructor(locale: Locale);
|
|
25
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/view/annotationcounterbuttonview
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { ButtonView, View } from 'ckeditor5/src/ui';
|
|
6
|
+
import type { Locale } from 'ckeditor5/src/utils';
|
|
7
|
+
/**
|
|
8
|
+
* A view used in the sidebar by {@link module:comments/annotations/narrowsidebar~NarrowSidebar}.
|
|
9
|
+
*/
|
|
10
|
+
export default class AnnotationCounterButtonView extends ButtonView {
|
|
11
|
+
/**
|
|
12
|
+
* @observable
|
|
13
|
+
*/
|
|
14
|
+
isDirty: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @observable
|
|
17
|
+
*/
|
|
18
|
+
number: number;
|
|
19
|
+
/**
|
|
20
|
+
* @observable
|
|
21
|
+
*/
|
|
22
|
+
annotationType: string;
|
|
23
|
+
counterView: View;
|
|
24
|
+
constructor(locale: Locale);
|
|
25
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x25bf=['children','ck-annotation-counter','ck-annotation-counter__badge','add','toString','annotationType','...','number','counterView','bindTemplate','bind','_badge','icon','extendTemplate','isDirty','set','setTemplate'];(function(_0xb67ce5,_0x25bf2f){const _0x559d1f=function(_0x5038d4){while(--_0x5038d4){_0xb67ce5['push'](_0xb67ce5['shift']());}};_0x559d1f(++_0x25bf2f);}(_0x25bf,0x93));const _0x559d=function(_0xb67ce5,_0x25bf2f){_0xb67ce5=_0xb67ce5-0x0;let _0x559d1f=_0x25bf[_0xb67ce5];return _0x559d1f;};import{ButtonView as _0x2367d3,View as _0x40fcf5}from'ckeditor5/src/ui';import _0x4f02d5 from'../../../theme/icons/add-comment.svg';export default class D extends _0x2367d3{constructor(_0x41741e){super(_0x41741e);const _0x349384=this[_0x559d('0xf')];this[_0x559d('0x4')](_0x559d('0x3'),!0x1),this[_0x559d('0x4')](_0x559d('0xd'),0x0),this[_0x559d('0x10')](_0x559d('0x0'))['to'](this,'isDirty',this,_0x559d('0xd'),(_0x553606,_0x49ac8c)=>_0x553606?_0x559d('0xc'):_0x49ac8c[_0x559d('0xa')]()),this[_0x559d('0x4')](_0x559d('0xb'),''),this[_0x559d('0x1')]=_0x4f02d5,this[_0x559d('0x2')]({'attributes':{'class':[_0x559d('0x7')]}}),this['counterView']=new _0x40fcf5(),this[_0x559d('0xe')][_0x559d('0x5')]({'tag':'span','attributes':{'class':[_0x559d('0x8'),_0x349384['to'](_0x559d('0xb'),_0x31b8c8=>'ck-annotation-counter__badge--'+_0x31b8c8),_0x349384['if'](_0x559d('0x3'),'ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x349384['to'](_0x559d('0x0'))}]}),this[_0x559d('0x6')][_0x559d('0x9')](this[_0x559d('0xe')]);}}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/annotations/view/annotationview
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { View, type ViewCollection } from 'ckeditor5/src/ui';
|
|
6
|
-
import { FocusTracker, KeystrokeHandler, type Rect, type Locale } from 'ckeditor5/src/utils';
|
|
7
|
-
import '../../../theme/annotation.css';
|
|
8
|
-
/**
|
|
9
|
-
* A wrapping view for any view added to the `Annotations` plugin.
|
|
10
|
-
*
|
|
11
|
-
* It introduces functionalities that make the given view ready to be used as an annotation, such as focus tracking, height resizing,
|
|
12
|
-
* and other observable properties that help share current annotation state across different UIs.
|
|
13
|
-
*/
|
|
14
|
-
export default class AnnotationView extends View {
|
|
15
|
-
/**
|
|
16
|
-
* Tracks focus on the annotation view.
|
|
17
|
-
*
|
|
18
|
-
* Add a DOM element to this focus tracker to prevent blurring annotation view
|
|
19
|
-
* when the DOM element is focused.
|
|
20
|
-
*/
|
|
21
|
-
readonly focusTracker: FocusTracker;
|
|
22
|
-
readonly id: string;
|
|
23
|
-
readonly keystrokes: KeystrokeHandler;
|
|
24
|
-
/**
|
|
25
|
-
* Target rectangle to which the annotation should be attached.
|
|
26
|
-
*
|
|
27
|
-
* @observable
|
|
28
|
-
*/
|
|
29
|
-
targetRect: Rect | null;
|
|
30
|
-
/**
|
|
31
|
-
* Annotation view height.
|
|
32
|
-
*
|
|
33
|
-
* @observable
|
|
34
|
-
*/
|
|
35
|
-
height: number;
|
|
36
|
-
/**
|
|
37
|
-
* Informs if an annotation is active.
|
|
38
|
-
*
|
|
39
|
-
* @observable
|
|
40
|
-
*/
|
|
41
|
-
isActive: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Informs if there are unsaved changes in the annotation.
|
|
44
|
-
*
|
|
45
|
-
* @observable
|
|
46
|
-
*/
|
|
47
|
-
isDirty: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* The number of items in the annotation.
|
|
50
|
-
*
|
|
51
|
-
* @observable
|
|
52
|
-
*/
|
|
53
|
-
length: number;
|
|
54
|
-
/**
|
|
55
|
-
* @observable
|
|
56
|
-
*/
|
|
57
|
-
type: string;
|
|
58
|
-
element: HTMLElement;
|
|
59
|
-
/**
|
|
60
|
-
* Collection for content views.
|
|
61
|
-
*/
|
|
62
|
-
content: ViewCollection;
|
|
63
|
-
/**
|
|
64
|
-
* The inner annotation view.
|
|
65
|
-
*/
|
|
66
|
-
mainView: AnnotationMainView;
|
|
67
|
-
/**
|
|
68
|
-
* @inheritDoc
|
|
69
|
-
*/
|
|
70
|
-
constructor(locale: Locale, mainView: AnnotationMainView);
|
|
71
|
-
/**
|
|
72
|
-
* @inheritDoc
|
|
73
|
-
*/
|
|
74
|
-
render(): void;
|
|
75
|
-
/**
|
|
76
|
-
* @inheritDoc
|
|
77
|
-
*/
|
|
78
|
-
destroy(): void;
|
|
79
|
-
/**
|
|
80
|
-
* Focuses the annotation view.
|
|
81
|
-
*/
|
|
82
|
-
focus(): void;
|
|
83
|
-
}
|
|
84
|
-
export interface AnnotationMainView extends View {
|
|
85
|
-
isActive: boolean;
|
|
86
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/view/annotationview
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { View, type ViewCollection } from 'ckeditor5/src/ui';
|
|
6
|
+
import { FocusTracker, KeystrokeHandler, type Rect, type Locale } from 'ckeditor5/src/utils';
|
|
7
|
+
import '../../../theme/annotation.css';
|
|
8
|
+
/**
|
|
9
|
+
* A wrapping view for any view added to the `Annotations` plugin.
|
|
10
|
+
*
|
|
11
|
+
* It introduces functionalities that make the given view ready to be used as an annotation, such as focus tracking, height resizing,
|
|
12
|
+
* and other observable properties that help share current annotation state across different UIs.
|
|
13
|
+
*/
|
|
14
|
+
export default class AnnotationView extends View {
|
|
15
|
+
/**
|
|
16
|
+
* Tracks focus on the annotation view.
|
|
17
|
+
*
|
|
18
|
+
* Add a DOM element to this focus tracker to prevent blurring annotation view
|
|
19
|
+
* when the DOM element is focused.
|
|
20
|
+
*/
|
|
21
|
+
readonly focusTracker: FocusTracker;
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly keystrokes: KeystrokeHandler;
|
|
24
|
+
/**
|
|
25
|
+
* Target rectangle to which the annotation should be attached.
|
|
26
|
+
*
|
|
27
|
+
* @observable
|
|
28
|
+
*/
|
|
29
|
+
targetRect: Rect | null;
|
|
30
|
+
/**
|
|
31
|
+
* Annotation view height.
|
|
32
|
+
*
|
|
33
|
+
* @observable
|
|
34
|
+
*/
|
|
35
|
+
height: number;
|
|
36
|
+
/**
|
|
37
|
+
* Informs if an annotation is active.
|
|
38
|
+
*
|
|
39
|
+
* @observable
|
|
40
|
+
*/
|
|
41
|
+
isActive: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Informs if there are unsaved changes in the annotation.
|
|
44
|
+
*
|
|
45
|
+
* @observable
|
|
46
|
+
*/
|
|
47
|
+
isDirty: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The number of items in the annotation.
|
|
50
|
+
*
|
|
51
|
+
* @observable
|
|
52
|
+
*/
|
|
53
|
+
length: number;
|
|
54
|
+
/**
|
|
55
|
+
* @observable
|
|
56
|
+
*/
|
|
57
|
+
type: string;
|
|
58
|
+
element: HTMLElement;
|
|
59
|
+
/**
|
|
60
|
+
* Collection for content views.
|
|
61
|
+
*/
|
|
62
|
+
content: ViewCollection;
|
|
63
|
+
/**
|
|
64
|
+
* The inner annotation view.
|
|
65
|
+
*/
|
|
66
|
+
mainView: AnnotationMainView;
|
|
67
|
+
/**
|
|
68
|
+
* @inheritDoc
|
|
69
|
+
*/
|
|
70
|
+
constructor(locale: Locale, mainView: AnnotationMainView);
|
|
71
|
+
/**
|
|
72
|
+
* @inheritDoc
|
|
73
|
+
*/
|
|
74
|
+
render(): void;
|
|
75
|
+
/**
|
|
76
|
+
* @inheritDoc
|
|
77
|
+
*/
|
|
78
|
+
destroy(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Focuses the annotation view.
|
|
81
|
+
*/
|
|
82
|
+
focus(): void;
|
|
83
|
+
}
|
|
84
|
+
export interface AnnotationMainView extends View {
|
|
85
|
+
isActive: boolean;
|
|
86
|
+
}
|