@ckeditor/ckeditor5-comments 36.0.1 → 37.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/build/comments.js +2 -2
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/lang/contexts.json +8 -1
- package/lang/translations/af.po +28 -0
- package/lang/translations/ar.po +28 -0
- package/lang/translations/bg.po +28 -0
- package/lang/translations/bn.po +28 -0
- package/lang/translations/bs.po +28 -0
- package/lang/translations/ca.po +28 -0
- package/lang/translations/cs.po +28 -0
- package/lang/translations/da.po +28 -0
- package/lang/translations/de-ch.po +28 -0
- package/lang/translations/de.po +28 -0
- package/lang/translations/el.po +28 -0
- package/lang/translations/en-au.po +28 -0
- package/lang/translations/en.po +28 -0
- package/lang/translations/es-co.po +28 -0
- package/lang/translations/es.po +28 -0
- package/lang/translations/et.po +28 -0
- package/lang/translations/fa.po +28 -0
- package/lang/translations/fi.po +28 -0
- package/lang/translations/fr.po +28 -0
- package/lang/translations/gl.po +28 -0
- package/lang/translations/he.po +28 -0
- package/lang/translations/hi.po +28 -0
- package/lang/translations/hr.po +28 -0
- package/lang/translations/hu.po +28 -0
- package/lang/translations/id.po +28 -0
- package/lang/translations/it.po +28 -0
- package/lang/translations/ja.po +28 -0
- package/lang/translations/jv.po +28 -0
- package/lang/translations/ko.po +28 -0
- package/lang/translations/lt.po +28 -0
- package/lang/translations/lv.po +28 -0
- package/lang/translations/ms.po +28 -0
- package/lang/translations/nl.po +28 -0
- package/lang/translations/no.po +28 -0
- package/lang/translations/pl.po +28 -0
- package/lang/translations/pt-br.po +28 -0
- package/lang/translations/pt.po +28 -0
- package/lang/translations/ro.po +28 -0
- package/lang/translations/ru.po +28 -0
- package/lang/translations/sk.po +28 -0
- package/lang/translations/sr-latn.po +28 -0
- package/lang/translations/sr.po +29 -1
- package/lang/translations/sv.po +28 -0
- package/lang/translations/th.po +28 -0
- package/lang/translations/tk.po +28 -0
- package/lang/translations/tr.po +28 -0
- package/lang/translations/tt.po +28 -0
- package/lang/translations/ug.po +28 -0
- package/lang/translations/uk.po +28 -0
- package/lang/translations/ur.po +28 -0
- package/lang/translations/vi.po +28 -0
- package/lang/translations/zh-cn.po +28 -0
- package/lang/translations/zh.po +28 -0
- package/package.json +19 -3
- package/src/annotations/annotation.d.ts +86 -0
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.d.ts +94 -0
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.d.ts +150 -0
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.d.ts +227 -0
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +62 -0
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +84 -0
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +80 -0
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.d.ts +96 -0
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -0
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.d.ts +86 -0
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.d.ts +51 -0
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.d.ts +28 -0
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.d.ts +72 -0
- package/src/annotations/widesidebar.js +1 -1
- package/src/augmentation.d.ts +54 -0
- package/src/augmentation.js +23 -0
- package/src/comments/addcommentthreadcommand.d.ts +31 -0
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.d.ts +25 -0
- package/src/comments/commentsarchive.js +23 -0
- package/src/comments/commentsarchiveui.d.ts +32 -0
- package/src/comments/commentsarchiveui.js +23 -0
- package/src/comments/commentsediting.d.ts +71 -0
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1009 -0
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +25 -0
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -0
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.d.ts +17 -0
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -0
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -0
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -0
- package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
- package/src/comments/ui/commentthreadcontroller.d.ts +64 -0
- package/src/comments/ui/commentthreadcontroller.js +1 -1
- package/src/comments/ui/view/basecommentthreadview.d.ts +108 -0
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.d.ts +108 -0
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -0
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.d.ts +10 -0
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.d.ts +76 -0
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.d.ts +34 -0
- package/src/comments/ui/view/commentsarchiveview.js +23 -0
- package/src/comments/ui/view/commentslistview.d.ts +96 -0
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -0
- package/src/comments/ui/view/commentthreadheaderview.js +23 -0
- package/src/comments/ui/view/commentthreadinputview.d.ts +37 -0
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.d.ts +108 -0
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.d.ts +231 -0
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.d.ts +22 -0
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +28 -0
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +172 -0
- package/src/config.js +23 -0
- package/src/index.d.ts +19 -0
- package/src/index.js +1 -1
- package/src/utils/common-translations.d.ts +5 -0
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.d.ts +13 -0
- package/src/utils/createmutationobserver.js +1 -1
- package/theme/annotation.css +1 -0
- package/theme/comment.css +31 -0
- package/theme/commentsarchive.css +40 -0
- package/theme/commentthread.css +68 -1
- package/theme/icons/add-comment.svg +1 -1
- package/theme/icons/comments-archive.svg +11 -0
- package/theme/icons/undo.svg +1 -0
- package/theme/sidebar.css +4 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/inlineannotations
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type PluginDependencies, type Editor } from 'ckeditor5/src/core';
|
|
6
|
+
import { type AnnotationsUI } from './annotationsuis';
|
|
7
|
+
import './../../theme/annotation-inline.css';
|
|
8
|
+
import type Annotation from './annotation';
|
|
9
|
+
import type AnnotationCollection from './annotationcollection';
|
|
10
|
+
/**
|
|
11
|
+
* The popup-style UI for displaying annotations next to editor target elements.
|
|
12
|
+
*
|
|
13
|
+
* It displays {@link module:comments/annotations/annotation~Annotation annotations} in the
|
|
14
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon balloon} where the current
|
|
15
|
+
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#activeAnnotation} is the displayed one.
|
|
16
|
+
*
|
|
17
|
+
* Note: this UI type works only with {@link module:core/editor/editor~Editor the Editor} and cannot be used in integrations where
|
|
18
|
+
* there is only {@link module:core/context~Context context} without any editor.
|
|
19
|
+
*
|
|
20
|
+
* This UI is intended for narrow screens.
|
|
21
|
+
*
|
|
22
|
+
* To activate this UI use one of the following:
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'inline' );
|
|
26
|
+
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'inline', filter );
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
30
|
+
*/
|
|
31
|
+
export default class InlineAnnotations extends Plugin implements AnnotationsUI<Plugin> {
|
|
32
|
+
/**
|
|
33
|
+
* An active annotation tracked by this UI.
|
|
34
|
+
*
|
|
35
|
+
* @observable
|
|
36
|
+
*/
|
|
37
|
+
activeAnnotation: Annotation | null;
|
|
38
|
+
isAttached: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* A collection of annotations controlled by this UI.
|
|
41
|
+
*
|
|
42
|
+
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
43
|
+
*
|
|
44
|
+
* It is set to `null` if `InlineAnnotations` is not
|
|
45
|
+
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#attach attached}.
|
|
46
|
+
*/
|
|
47
|
+
annotations: AnnotationCollection | null;
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
static get requires(): PluginDependencies;
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
static get pluginName(): 'InlineAnnotations';
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
constructor(editor: Editor);
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
init(): void;
|
|
64
|
+
/**
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
afterInit(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the active annotation for this UI.
|
|
70
|
+
*/
|
|
71
|
+
setActiveAnnotation(annotation: Annotation | null): void;
|
|
72
|
+
/**
|
|
73
|
+
* @inheritDoc
|
|
74
|
+
*/
|
|
75
|
+
attach(annotations: AnnotationCollection): void;
|
|
76
|
+
/**
|
|
77
|
+
* @inheritDoc
|
|
78
|
+
*/
|
|
79
|
+
detach(): void;
|
|
80
|
+
/**
|
|
81
|
+
* @inheritDoc
|
|
82
|
+
*/
|
|
83
|
+
destroy(): void;
|
|
84
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x171d=['hasView','focusTracker','collapse','domConverter','annotations','_removeAnnotationFromBalloon','_balloon','change:isFocused','push','activeAnnotation','inlineannotations-not-allowed-with-context','_forceRefresh','_addAnnotationToBalloon','blur','register','updatePosition','focus','update','fromRect','switchTo','keystrokes','destroy','listenTo','isFocused','width','map','left','top','includes','clear','getClientRects','stopListening','getByView','selection','set','hasActive','_setSelectedAnnotations','afterInit','has','viewRangeToDom','visibleView','addObserver','document','refresh','editing','inline','pluginName','editor','init','_closeAnnotation','right','delete','inlineannotations-attach-already-attached','_getBalloonTargetForAnnotation','view','from','editableElement','context','length','_addedAnnotations','add','detach','remove','isAttached','getOrderedSelectedAnnotations','setActiveAnnotation','requires','getFirstRange','get','_selectedAnnotations','Esc','targetRect','_manuallyClosed','plugins','bottom'];(function(_0x273781,_0x171dc5){const _0x5b0fbc=function(_0x176ad3){while(--_0x176ad3){_0x273781['push'](_0x273781['shift']());}};_0x5b0fbc(++_0x171dc5);}(_0x171d,0x108));const _0x5b0f=function(_0x273781,_0x171dc5){_0x273781=_0x273781-0x0;let _0x5b0fbc=_0x171d[_0x273781];return _0x5b0fbc;};import{Plugin as _0x2a21b0}from'ckeditor5/src/core';import _0x506609 from'./annotationsuis';import _0x15b0f5 from'./editorannotations';import{ContextualBalloon as _0xe9219}from'ckeditor5/src/ui';import{MouseObserver as _0x15ca21}from'ckeditor5/src/engine';import{CKEditorError as _0x1ebf5c,Rect as _0x2bb842}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x2a21b0{static get[_0x5b0f('0x1b')](){return[_0x15b0f5,_0xe9219,_0x506609];}static get[_0x5b0f('0x7')](){return'InlineAnnotations';}constructor(_0x166712){super(_0x166712),_0x166712[_0x5b0f('0x5')][_0x5b0f('0xf')][_0x5b0f('0x2')](_0x15ca21),this['isAttached']=!0x1,this[_0x5b0f('0x46')](_0x5b0f('0x2d'),null),this['annotations']=null,this[_0x5b0f('0x21')]=new Set(),this[_0x5b0f('0x2a')]=_0x166712[_0x5b0f('0x22')][_0x5b0f('0x1d')](_0xe9219),this[_0x5b0f('0x14')]=new Set(),this[_0x5b0f('0x1e')]=[],this[_0x5b0f('0x2f')]=!0x1;}[_0x5b0f('0x9')](){const _0x8afe8e=this['editor'][_0x5b0f('0x22')]['get'](_0x506609);_0x8afe8e[_0x5b0f('0x12')]===this[_0x5b0f('0x8')]&&(_0x8afe8e[_0x5b0f('0x32')](_0x5b0f('0x6'),this),this[_0x5b0f('0x8')][_0x5b0f('0x38')][_0x5b0f('0x46')](_0x5b0f('0x1f'),(_0x44eca4,_0x598aef)=>{const _0x393252=this['_balloon'];if(this['isAttached']&&_0x393252[_0x5b0f('0x1')]){const _0x9bf357=this[_0x5b0f('0x28')][_0x5b0f('0x44')](_0x393252[_0x5b0f('0x1')]);_0x9bf357&&this['_closeAnnotation'](_0x9bf357),_0x598aef();}}));}[_0x5b0f('0x49')](){const _0x28f9a8=this[_0x5b0f('0x8')][_0x5b0f('0x22')]['get'](_0x506609);_0x28f9a8[_0x5b0f('0x12')]===this['editor']&&(_0x28f9a8[_0x5b0f('0x47')]()||_0x28f9a8[_0x5b0f('0x37')](_0x5b0f('0x6')));}['setActiveAnnotation'](_0x2d8212){_0x2d8212!==this[_0x5b0f('0x2d')]&&(this[_0x5b0f('0x2d')]&&(this['activeAnnotation']['isActive']=!0x1),_0x2d8212&&this[_0x5b0f('0x8')]['ui'][_0x5b0f('0x25')][_0x5b0f('0x3b')]&&(this['annotations'][_0x5b0f('0x4a')](_0x2d8212)&&this[_0x5b0f('0x30')](_0x2d8212,!0x0),_0x2d8212['isActive']=!0x0),_0x2d8212||this[_0x5b0f('0x48')]([]),this[_0x5b0f('0x2d')]=_0x2d8212);}['attach'](_0x19b982){this['annotations']=_0x19b982;const _0x6f4150=this[_0x5b0f('0x8')][_0x5b0f('0x22')][_0x5b0f('0x1d')](_0x506609),_0x17cff8=this[_0x5b0f('0x2a')];if(this['isAttached'])throw new _0x1ebf5c(_0x5b0f('0xd'),this);if(_0x6f4150[_0x5b0f('0x12')]!==this[_0x5b0f('0x8')])throw new _0x1ebf5c(_0x5b0f('0x2e'),this);const _0x320368=this[_0x5b0f('0x8')][_0x5b0f('0x22')][_0x5b0f('0x1d')](_0x15b0f5);this[_0x5b0f('0x3a')](_0x320368,_0x5b0f('0x4'),()=>{const _0x5afcc0=_0x320368[_0x5b0f('0x19')]({'annotations':this[_0x5b0f('0x28')],'activeAnnotation':this['activeAnnotation']});var _0x3bc030,_0x59a78c;!this[_0x5b0f('0x2f')]&&(_0x3bc030=_0x5afcc0,_0x59a78c=this[_0x5b0f('0x1e')],_0x3bc030[_0x5b0f('0x13')]===_0x59a78c[_0x5b0f('0x13')]&&_0x3bc030['every'](_0x4930d7=>_0x59a78c[_0x5b0f('0x40')](_0x4930d7)))||(this[_0x5b0f('0x2f')]=!0x1,this['_setSelectedAnnotations'](_0x5afcc0),this[_0x5b0f('0x1a')](_0x5afcc0[0x0]||null));}),this[_0x5b0f('0x3a')](_0x320368,_0x5b0f('0x31'),(_0x25ee74,{isAnnotationTracked:_0x22ee03})=>{this[_0x5b0f('0x2d')]&&_0x22ee03(this[_0x5b0f('0x2d')])&&(this['_setSelectedAnnotations']([]),this[_0x5b0f('0x1a')](null));}),this[_0x5b0f('0x3a')](this[_0x5b0f('0x8')]['ui'][_0x5b0f('0x25')],_0x5b0f('0x2b'),(_0x3aeae6,_0x476ac8,_0x4f5158)=>{_0x4f5158||this['setActiveAnnotation'](null);}),this[_0x5b0f('0x3a')](_0x19b982,_0x5b0f('0x17'),(_0xc462a4,_0x3f7e14)=>{this[_0x5b0f('0x29')](_0x3f7e14),_0x3f7e14===this[_0x5b0f('0x2d')]&&this[_0x5b0f('0x1a')](null);}),this[_0x5b0f('0x3a')](_0x17cff8,'change:visibleView',(_0x865fcd,_0x256638,_0x484ff3,_0x532a29)=>{_0x532a29&&this[_0x5b0f('0x43')](_0x532a29);const _0x448749=_0x19b982[_0x5b0f('0x44')](_0x484ff3);_0x484ff3&&_0x448749&&(this[_0x5b0f('0x3a')](_0x484ff3,'change:height',()=>{_0x17cff8[_0x5b0f('0x33')]();}),this[_0x5b0f('0x3a')](_0x484ff3,_0x5b0f('0x1f'),()=>{this['_closeAnnotation'](_0x448749),this['editor'][_0x5b0f('0x5')][_0x5b0f('0xf')][_0x5b0f('0x34')]();}),this[_0x5b0f('0x2d')]!==_0x448749&&this[_0x5b0f('0x1a')](_0x448749));}),this[_0x5b0f('0x3a')](this[_0x5b0f('0x8')]['ui'],_0x5b0f('0x35'),()=>{_0x17cff8[_0x5b0f('0x1')]&&(_0x19b982[_0x5b0f('0x44')](_0x17cff8['visibleView'])&&_0x17cff8[_0x5b0f('0x33')]());}),this[_0x5b0f('0x3a')](this[_0x5b0f('0x8')]['editing'][_0x5b0f('0xf')][_0x5b0f('0x3')],'mousedown',()=>{this[_0x5b0f('0x2f')]=!0x0,this['_manuallyClosed'][_0x5b0f('0x41')]();}),this['editor'][_0x5b0f('0x5')][_0x5b0f('0xf')][_0x5b0f('0x3')][_0x5b0f('0x45')][_0x5b0f('0x11')]&&this[_0x5b0f('0x8')][_0x5b0f('0x5')][_0x5b0f('0xf')][_0x5b0f('0x34')](),this[_0x5b0f('0x18')]=!0x0;}['detach'](){if(!this[_0x5b0f('0x18')])throw new _0x1ebf5c('inlineannotations-detach-not-attached',this);this[_0x5b0f('0x1a')](null);for(const _0x990a1c of this[_0x5b0f('0x14')])this['_removeAnnotationFromBalloon'](_0x990a1c);this[_0x5b0f('0x43')](),this[_0x5b0f('0x18')]=!0x1,this[_0x5b0f('0x28')]=null;}[_0x5b0f('0x39')](){this[_0x5b0f('0x18')]&&this[_0x5b0f('0x16')]();}[_0x5b0f('0x48')](_0xaac4f4){for(const _0x174f68 of this[_0x5b0f('0x1e')])_0xaac4f4['includes'](_0x174f68)||this[_0x5b0f('0x21')][_0x5b0f('0xc')](_0x174f68);for(const _0x20c541 of this[_0x5b0f('0x28')])_0xaac4f4[_0x5b0f('0x40')](_0x20c541)||this[_0x5b0f('0x29')](_0x20c541);if(this[_0x5b0f('0x8')]['ui'][_0x5b0f('0x25')][_0x5b0f('0x3b')])for(const _0x138fc4 of _0xaac4f4)this[_0x5b0f('0x30')](_0x138fc4);this[_0x5b0f('0x1e')]=_0xaac4f4;}[_0x5b0f('0x30')](_0x19c8d1,_0xbf7abd=!0x1){this['_manuallyClosed'][_0x5b0f('0x4a')](_0x19c8d1)||(this[_0x5b0f('0x14')][_0x5b0f('0x4a')](_0x19c8d1)||this[_0x5b0f('0x2a')]['hasView'](_0x19c8d1[_0x5b0f('0xf')])||(this['_addedAnnotations'][_0x5b0f('0x15')](_0x19c8d1),this[_0x5b0f('0x2a')][_0x5b0f('0x15')]({'stackId':_0x19c8d1[_0x5b0f('0xf')]['id'],'view':_0x19c8d1[_0x5b0f('0xf')],'position':{'target':()=>this[_0x5b0f('0xe')](_0x19c8d1)}})),_0xbf7abd&&this['_balloon']['showStack'](_0x19c8d1[_0x5b0f('0xf')]['id']));}[_0x5b0f('0xe')](_0x30c455){const _0x34b11a=_0x30c455['target'],_0x492ce7=this[_0x5b0f('0x8')]['editing'][_0x5b0f('0xf')],_0x1581fe=_0x492ce7[_0x5b0f('0x3')][_0x5b0f('0x45')][_0x5b0f('0x1c')](),_0x5641b4=_0x492ce7[_0x5b0f('0x27')][_0x5b0f('0x0')](_0x1581fe);if(_0x5641b4[_0x5b0f('0x26')](!0x0),_0x34b11a){if(_0x34b11a instanceof _0x2bb842)return _0x34b11a;let _0x4f1eca=[];for(const _0x2e6c24 of _0x34b11a)_0x4f1eca['push'](...(_0x70fd4d=_0x2e6c24[_0x5b0f('0x42')](),Array[_0x5b0f('0x10')](_0x70fd4d)[_0x5b0f('0x3d')](DOMRect[_0x5b0f('0x36')])));_0x4f1eca=function(_0x3049fc){const _0x408cf5=[];let _0x45cdb3=_0x3049fc[0x0];for(let _0x14ab8f=0x1;_0x14ab8f<_0x3049fc[_0x5b0f('0x13')];_0x14ab8f++)F(_0x45cdb3,_0x3049fc[_0x14ab8f])?_0x45cdb3['width']+=_0x3049fc[_0x14ab8f][_0x5b0f('0x3c')]:(_0x408cf5[_0x5b0f('0x2c')](_0x45cdb3),_0x45cdb3=_0x3049fc[_0x14ab8f]);return _0x408cf5['push'](_0x45cdb3),_0x408cf5;}(_0x4f1eca);const _0x4368c3=_0x5641b4['getBoundingClientRect']();return _0x4f1eca['find'](_0x313a74=>_0x313a74['top']<=_0x4368c3[_0x5b0f('0x3f')]&&_0x313a74[_0x5b0f('0x23')]>=_0x4368c3['bottom']&&_0x313a74[_0x5b0f('0x3e')]<=_0x4368c3['left']&&_0x313a74[_0x5b0f('0xb')]>=_0x4368c3[_0x5b0f('0xb')])||_0x4f1eca[0x0];}var _0x70fd4d;return _0x30c455[_0x5b0f('0x20')]||_0x5641b4;}[_0x5b0f('0x29')](_0x1257a6){this[_0x5b0f('0x14')]['has'](_0x1257a6)&&this['_balloon'][_0x5b0f('0x24')](_0x1257a6['view'])&&(this['_addedAnnotations'][_0x5b0f('0xc')](_0x1257a6),this[_0x5b0f('0x2a')]['remove'](_0x1257a6[_0x5b0f('0xf')]));}[_0x5b0f('0xa')](_0x16fb4d){this[_0x5b0f('0x21')]['add'](_0x16fb4d),this[_0x5b0f('0x29')](_0x16fb4d);}}function F(_0x3abd2e,_0x4b66e2){return _0x3abd2e[_0x5b0f('0x3f')]===_0x4b66e2[_0x5b0f('0x3f')]&&_0x3abd2e[_0x5b0f('0x23')]===_0x4b66e2[_0x5b0f('0x23')]&&_0x3abd2e[_0x5b0f('0xb')]===_0x4b66e2['left'];}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/narrowsidebar
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { ContextPlugin, Context, type ContextPluginDependencies, type Editor } from 'ckeditor5/src/core';
|
|
6
|
+
import { type AnnotationsUI } from './annotationsuis';
|
|
7
|
+
import { BalloonPanelView, BodyCollection } from 'ckeditor5/src/ui';
|
|
8
|
+
import '../../theme/sidebar-narrow.css';
|
|
9
|
+
import type Annotation from './annotation';
|
|
10
|
+
import type AnnotationCollection from './annotationcollection';
|
|
11
|
+
/**
|
|
12
|
+
* The narrow sidebar UI for displaying annotations.
|
|
13
|
+
*
|
|
14
|
+
* Binds {@link module:comments/annotations/annotations~Annotations} plugin with
|
|
15
|
+
* {@link module:comments/annotations/sidebar~Sidebar} plugin to display annotations in the sidebar as
|
|
16
|
+
* {@link module:comments/annotations/view/annotationcounterbuttonview~AnnotationCounterButtonView small icons}.
|
|
17
|
+
*
|
|
18
|
+
* After selecting an annotation the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} with an
|
|
19
|
+
* {@link module:comments/annotations/view/annotationview~AnnotationView} appears attached to the sidebar item.
|
|
20
|
+
*
|
|
21
|
+
* This UI is intended for medium-sized viewports.
|
|
22
|
+
*
|
|
23
|
+
* To activate this UI use one of the following:
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'narrowSidebar' );
|
|
27
|
+
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'narrowSidebar', filter );
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
31
|
+
*/
|
|
32
|
+
export default class NarrowSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
|
|
33
|
+
/**
|
|
34
|
+
* An active annotation tracked by this UI.
|
|
35
|
+
*/
|
|
36
|
+
activeAnnotation: Annotation | null;
|
|
37
|
+
bodyCollection: BodyCollection;
|
|
38
|
+
balloonPanelView: BalloonPanelView;
|
|
39
|
+
isAttached: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* A collection of annotations controlled by this UI.
|
|
42
|
+
*
|
|
43
|
+
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
44
|
+
*
|
|
45
|
+
* It is set to `null` if `NarrowSidebar` is not {@link module:comments/annotations/narrowsidebar~NarrowSidebar#attach attached}.
|
|
46
|
+
*/
|
|
47
|
+
annotations: AnnotationCollection | null;
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
static get requires(): ContextPluginDependencies;
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
static get pluginName(): 'NarrowSidebar';
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
constructor(context: Context | Editor);
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
init(): void;
|
|
64
|
+
/**
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
attach(annotations: AnnotationCollection): void;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the active annotation for this UI.
|
|
70
|
+
*/
|
|
71
|
+
setActiveAnnotation(annotation: Annotation | null): void;
|
|
72
|
+
/**
|
|
73
|
+
* @inheritDoc
|
|
74
|
+
*/
|
|
75
|
+
detach(): void;
|
|
76
|
+
/**
|
|
77
|
+
* @inheritDoc
|
|
78
|
+
*/
|
|
79
|
+
destroy(): void;
|
|
80
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const _0x2101=['activeAnnotation','keyCode','rearrange','destroy','_detachListeners','balloonPanelView','_attachToContainer','setActiveAnnotation','detachFromDom','refresh','_integrateWithEditorAnnotations','isAttached','NarrowSidebar','_refreshPositioningDebounced','hasDomSelection','attach','_domEmitter','high','refreshPositioning','focus','change:container','attachToDom','pin','ready','_destroyEditorAnnotationsIntegration','uiUpdate','plugins','_updateBalloonPosition','_annotations','resize','editors','from','register','annotationType','number','southArrowNorth','detach','execute','add','_editorAnnotations','Sidebar','type','_setSelectedAnnotations','_showBalloon','delete','clear','preventDefault','isDirty','narrowSidebar','narrowsidebar-attach-already-attached','_selectedAnnotations','content','change:height','keydown','stop','context','northArrowSouthWest','preventClosingBalloon','northArrowSouthEast','bodyCollection','length','view','init','EditorAnnotations','isVisible','has','getSidebarItemView','stopListening','set:container','remove','first','getByView','locale','requires','values','_refreshPositioning','mousedown','blur','get','getOrderedSelectedAnnotations','_attachListeners','unpin','contains','annotations','set','_manuallyClosedAnnotationViews','element','southArrowNorthEast','_hideBalloon','defaultPositions','create','removeEventListener','_annotationToNarrowView','listenTo','stopPropagation','low','target'];(function(_0x4ff4d2,_0x210150){const _0x50a65f=function(_0x2455a8){while(--_0x2455a8){_0x4ff4d2['push'](_0x4ff4d2['shift']());}};_0x50a65f(++_0x210150);}(_0x2101,0x1b4));const _0x50a6=function(_0x4ff4d2,_0x210150){_0x4ff4d2=_0x4ff4d2-0x0;let _0x50a65f=_0x2101[_0x4ff4d2];return _0x50a65f;};import{ContextPlugin as _0x26f94f}from'ckeditor5/src/core';import _0x3118b2 from'./annotationsuis';import _0xbd81b9 from'./sidebar';import _0x29d404 from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x4d1e5d,BodyCollection as _0x3c37fa}from'ckeditor5/src/ui';import{CKEditorError as _0x1af5dc,DomEmitterMixin as _0x390e02,keyCodes as _0x26718d,Collection as _0x58ba3a}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x114b9b}from'lodash-es';export default class s extends _0x26f94f{static get[_0x50a6('0x19')](){return[_0xbd81b9,_0x3118b2];}static get['pluginName'](){return _0x50a6('0x3d');}constructor(_0x5729bc){super(_0x5729bc),this[_0x50a6('0x3c')]=!0x1,this[_0x50a6('0x25')]=new Set(),this[_0x50a6('0x41')]=Object[_0x50a6('0x2a')](_0x390e02),this[_0x50a6('0x2c')]=new Map(),this[_0x50a6('0x24')]('activeAnnotation',null),this[_0x50a6('0x23')]=null,this[_0x50a6('0x2')]=[],this[_0x50a6('0x58')]=new _0x58ba3a(),this[_0x50a6('0x3e')]=_0x114b9b(()=>{this[_0x50a6('0x1b')]();},0xfa,{'leading':!0x1});}[_0x50a6('0xe')](){this['context'][_0x50a6('0x4b')][_0x50a6('0x1e')](_0x3118b2)[_0x50a6('0x51')](_0x50a6('0x0'),this),this[_0x50a6('0xb')]=new _0x3c37fa(this[_0x50a6('0x7')][_0x50a6('0x18')]),this[_0x50a6('0x36')]=new _0x4d1e5d(this[_0x50a6('0x7')][_0x50a6('0x18')]),this[_0x50a6('0xb')][_0x50a6('0x46')](),this[_0x50a6('0xb')][_0x50a6('0x57')](this['balloonPanelView']);}[_0x50a6('0x40')](_0x59b2a4){this[_0x50a6('0x23')]=_0x59b2a4;const _0x4efd05=this['context'][_0x50a6('0x4b')][_0x50a6('0x1e')](_0xbd81b9),_0x4d3527=this[_0x50a6('0x36')];if(_0x4efd05[_0x50a6('0x4d')]=_0x59b2a4,this[_0x50a6('0x3c')])throw new _0x1af5dc(_0x50a6('0x1'),this);this[_0x50a6('0x3c')]=!0x0,this[_0x50a6('0x2d')](_0x4efd05,_0x50a6('0x14'),()=>{this['detach'](),this[_0x50a6('0x2d')](_0x4efd05,_0x50a6('0x45'),_0x53d39a=>{_0x53d39a['off'](),this[_0x50a6('0x40')](_0x59b2a4);});}),_0x4efd05[_0x50a6('0x37')]({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x29fc69=_0x40ec96=>{const _0x4c2f24=new _0x29d404(this[_0x50a6('0x7')][_0x50a6('0x18')]);_0x4efd05['addAnnotation'](_0x40ec96,_0x4c2f24),this[_0x50a6('0x2c')]['set'](_0x40ec96,_0x4c2f24),_0x4c2f24['bind'](_0x50a6('0x60'),_0x50a6('0x52'),_0x50a6('0x53'))['to'](_0x40ec96[_0x50a6('0xd')],_0x50a6('0x60'),_0x50a6('0x5a'),_0x50a6('0xc')),_0x4c2f24['on'](_0x50a6('0x56'),()=>{this['_manuallyClosedAnnotationViews'][_0x50a6('0x5e')](),_0x4d3527[_0x50a6('0x3')]['first']!==_0x40ec96['view']?(this[_0x50a6('0x5c')](_0x40ec96),_0x40ec96[_0x50a6('0xd')][_0x50a6('0x26')][_0x50a6('0x44')](),this[_0x50a6('0x38')](_0x40ec96)):this[_0x50a6('0x38')](null);});};for(const _0x2b0174 of _0x59b2a4)_0x29fc69(_0x2b0174);this[_0x50a6('0x2d')](_0x59b2a4,_0x50a6('0x57'),(_0x52a7ea,_0xf12b08)=>{_0x29fc69(_0xf12b08);}),this[_0x50a6('0x2d')](_0x59b2a4,_0x50a6('0x15'),(_0xb026f8,_0xa1fac0,_0x4f4b5e)=>{this[_0x50a6('0x2c')]['get'](_0xa1fac0)['destroy'](),this[_0x50a6('0x2c')]['delete'](_0xa1fac0),_0x4efd05[_0x50a6('0x33')]({'removedAnnotation':_0xa1fac0,'previousAnnotation':_0x59b2a4['get'](_0x4f4b5e-0x1),'nextAnnotation':_0x59b2a4[_0x50a6('0x1e')](_0x4f4b5e+0x1)}),_0xa1fac0===this['activeAnnotation']&&this[_0x50a6('0x38')](null);},{'priority':_0x50a6('0x2f')}),this[_0x50a6('0x2d')](_0x59b2a4,'focus',(_0x2e7afe,_0x50b377)=>{this[_0x50a6('0x38')](_0x50b377);}),this[_0x50a6('0x2d')](_0x59b2a4,_0x50a6('0x1d'),()=>{this[_0x50a6('0x38')](null);}),this[_0x50a6('0x41')][_0x50a6('0x2d')](document,_0x50a6('0x5'),(_0x418143,_0xad62ee)=>{_0xad62ee[_0x50a6('0x32')]===_0x26718d['esc']&&_0x4d3527[_0x50a6('0x10')]&&(this['_manuallyClosedAnnotationViews'][_0x50a6('0x57')](_0x4d3527['content']['first']),this[_0x50a6('0x28')](),_0xad62ee[_0x50a6('0x2e')](),_0xad62ee[_0x50a6('0x5f')]());}),this[_0x50a6('0x41')][_0x50a6('0x2d')](document,_0x50a6('0x1c'),(_0x4e3e81,_0x230db8)=>{const _0x360481=_0x230db8['target'];_0x4d3527['isVisible']&&_0x4d3527[_0x50a6('0x26')][_0x50a6('0x22')](_0x360481)||_0x4efd05[_0x50a6('0xd')][_0x50a6('0x26')][_0x50a6('0x22')](_0x360481)||_0x4e3e81[_0x50a6('0x9')]||(this[_0x50a6('0x25')][_0x50a6('0x5e')](),this['_hideBalloon'](),this[_0x50a6('0x38')](null));});const _0x2638d3=this[_0x50a6('0x7')][_0x50a6('0x4f')]?this[_0x50a6('0x7')][_0x50a6('0x4f')]:new _0x58ba3a([this['context']]);for(const _0x133317 of _0x2638d3)this[_0x50a6('0x3b')](_0x133317);this[_0x50a6('0x2d')](_0x2638d3,'add',(_0x3c51be,_0x3286a4)=>{this['listenTo'](_0x3286a4,_0x50a6('0x48'),()=>{this['_integrateWithEditorAnnotations'](_0x3286a4);});}),this[_0x50a6('0x2d')](_0x2638d3,_0x50a6('0x15'),(_0x260d78,_0x30897c)=>{_0x30897c[_0x50a6('0x4b')]['has'](_0x50a6('0xf'))&&this['_destroyEditorAnnotationsIntegration'](_0x30897c[_0x50a6('0x4b')][_0x50a6('0x1e')](_0x50a6('0xf')));}),window['addEventListener'](_0x50a6('0x4e'),this[_0x50a6('0x3e')]),this[_0x50a6('0x1b')]();}[_0x50a6('0x38')](_0x491c48){if(_0x491c48===this[_0x50a6('0x31')])return;const _0x1c5b1b=this[_0x50a6('0x7')][_0x50a6('0x4b')][_0x50a6('0x1e')](_0x50a6('0x59'));if(_0x1c5b1b[_0x50a6('0x3a')]({'blurredAnnotation':this[_0x50a6('0x31')],'activatedAnnotation':_0x491c48,'disableAnimationOnActivatedAnnotation':!0x0}),_0x491c48)_0x1c5b1b[_0x50a6('0x12')](_0x491c48)?this[_0x50a6('0x5c')](_0x491c48):this[_0x50a6('0x28')]();else this['_hideBalloon']();this[_0x50a6('0x31')]=_0x491c48;}[_0x50a6('0x55')](){if(!this[_0x50a6('0x3c')])throw new _0x1af5dc('narrowsidebar-detach-not-attached',this);this[_0x50a6('0x38')](null);const _0x1e56cb=this[_0x50a6('0x7')][_0x50a6('0x4b')][_0x50a6('0x1e')](_0x50a6('0x59'));this[_0x50a6('0x28')](),Array[_0x50a6('0x50')](this['_annotationToNarrowView'][_0x50a6('0x1a')](),_0x31405d=>_0x31405d[_0x50a6('0x34')]()),this[_0x50a6('0x2c')][_0x50a6('0x5e')](),_0x1e56cb['_detachFromContainer'](this[_0x50a6('0x23')]),this[_0x50a6('0x13')](),this[_0x50a6('0x41')][_0x50a6('0x13')](),this[_0x50a6('0x13')](this['context'][_0x50a6('0x4f')]);for(const _0x209d0d of Array['from'](this[_0x50a6('0x58')]))this[_0x50a6('0x49')](_0x209d0d);window[_0x50a6('0x2b')]('resize',this[_0x50a6('0x3e')]),this[_0x50a6('0x3e')]['cancel'](),this[_0x50a6('0x2')]=[],this[_0x50a6('0x3c')]=!0x1,this[_0x50a6('0x23')]=null;}[_0x50a6('0x34')](){this['isAttached']&&this[_0x50a6('0x55')](),this['bodyCollection'][_0x50a6('0x39')]();}[_0x50a6('0x3b')](_0x5b52a1){const _0x47fc59=_0x5b52a1[_0x50a6('0x4b')][_0x50a6('0x1e')](_0x50a6('0xf')),_0x377211=this[_0x50a6('0x7')]['plugins'][_0x50a6('0x1e')](_0xbd81b9),_0x43d428=this[_0x50a6('0x23')],_0x2e9fa4=this[_0x50a6('0x36')],_0x274473=()=>{const _0x521c97=_0x47fc59[_0x50a6('0x1f')]({'activeAnnotation':this[_0x50a6('0x31')],'annotations':this[_0x50a6('0x23')]});this[_0x50a6('0x5b')](_0x521c97),this[_0x50a6('0x38')](_0x521c97[0x0]||null);};this[_0x50a6('0x2d')](_0x47fc59,_0x50a6('0x3a'),_0x274473),this[_0x50a6('0x2d')](_0x47fc59,_0x50a6('0x1d'),(_0x572926,{isAnnotationTracked:_0x2ae38c})=>{this[_0x50a6('0x31')]&&_0x2ae38c(this[_0x50a6('0x31')])&&(this['_setSelectedAnnotations']([]),this[_0x50a6('0x38')](null));}),this[_0x50a6('0x2d')](_0x47fc59,_0x50a6('0x4a'),()=>{this[_0x50a6('0x3e')]();}),this[_0x50a6('0x2d')](_0x43d428,_0x50a6('0x1d'),_0x30883f=>{_0x47fc59[_0x50a6('0x3f')]()&&_0x30883f[_0x50a6('0x6')]();},{'priority':_0x50a6('0x42')}),this[_0x50a6('0x41')][_0x50a6('0x2d')](document,_0x50a6('0x1c'),(_0x5cc423,_0x3b7e9a)=>{const _0x23b673=_0x3b7e9a[_0x50a6('0x30')];_0x2e9fa4[_0x50a6('0x10')]&&_0x2e9fa4['element'][_0x50a6('0x22')](_0x23b673)||_0x377211[_0x50a6('0xd')][_0x50a6('0x26')]['contains'](_0x23b673)||this[_0x50a6('0x31')]&&_0x47fc59[_0x50a6('0x3f')]()&&(_0x274473(),_0x5cc423[_0x50a6('0x9')]=!0x0);},{'priority':_0x50a6('0x42')}),this[_0x50a6('0x58')][_0x50a6('0x57')](_0x47fc59);}[_0x50a6('0x49')](_0x5ce8b6){_0x5ce8b6&&(this[_0x50a6('0x13')](_0x5ce8b6),this[_0x50a6('0x58')][_0x50a6('0x15')](_0x5ce8b6));}[_0x50a6('0x5b')](_0x59719d){for(const _0x546030 of this[_0x50a6('0x2')])_0x59719d['includes'](_0x546030)||this['_manuallyClosedAnnotationViews'][_0x50a6('0x5d')](_0x546030[_0x50a6('0xd')]);this[_0x50a6('0x2')]=_0x59719d;}[_0x50a6('0x1b')](){const _0x21ea93=this[_0x50a6('0x36')];this[_0x50a6('0x23')][_0x50a6('0x43')](),_0x21ea93['isVisible']&&this['_updateBalloonPosition']();}[_0x50a6('0x5c')](_0x51482f){if(this['_manuallyClosedAnnotationViews'][_0x50a6('0x11')](_0x51482f[_0x50a6('0xd')]))return;const _0x26527b=this[_0x50a6('0x36')][_0x50a6('0x3')][_0x50a6('0x16')];_0x26527b!==_0x51482f[_0x50a6('0xd')]?(_0x26527b&&this['_detachListeners'](_0x26527b),this[_0x50a6('0x20')](_0x51482f[_0x50a6('0xd')]),this[_0x50a6('0x36')][_0x50a6('0x3')][_0x50a6('0x5e')](),this[_0x50a6('0x36')][_0x50a6('0x3')][_0x50a6('0x57')](_0x51482f[_0x50a6('0xd')]),this[_0x50a6('0x4c')]()):this[_0x50a6('0x4c')]();}[_0x50a6('0x4c')](){const _0x535990=this[_0x50a6('0x36')][_0x50a6('0x3')]['first'],_0x1efc9a=this['annotations'][_0x50a6('0x17')](_0x535990);if(!this[_0x50a6('0x2c')][_0x50a6('0x11')](_0x1efc9a))return;const _0x40880b=this[_0x50a6('0x2c')][_0x50a6('0x1e')](_0x1efc9a)[_0x50a6('0x26')],_0x401108=function(){const _0x2c812f=_0x4d1e5d[_0x50a6('0x29')];return[_0x2c812f[_0x50a6('0x27')],_0x2c812f[_0x50a6('0xa')],_0x2c812f[_0x50a6('0x54')],_0x2c812f['northArrowSouth'],_0x2c812f['southArrowNorthWest'],_0x2c812f[_0x50a6('0x8')]];}();this[_0x50a6('0x36')][_0x50a6('0x47')]({'target':_0x40880b,'positions':_0x401108});}[_0x50a6('0x28')](){const _0x54636c=this[_0x50a6('0x36')],_0x5935a7=_0x54636c['content']['first'];_0x5935a7&&(this[_0x50a6('0x35')](_0x5935a7),_0x54636c[_0x50a6('0x21')](),_0x54636c[_0x50a6('0x3')]['clear']());}[_0x50a6('0x20')](_0x57d617){this[_0x50a6('0x2d')](_0x57d617,_0x50a6('0x4'),()=>this['_updateBalloonPosition']()),this['listenTo'](_0x57d617,'Esc',(_0xb1f39,_0x5e3dec)=>{this[_0x50a6('0x25')][_0x50a6('0x57')](_0x57d617),this[_0x50a6('0x28')](),_0x5e3dec();});}[_0x50a6('0x35')](_0x10f8c7){this[_0x50a6('0x13')](_0x10f8c7);}}
|
|
23
|
+
const _0xf1a5=['isVisible','_attachListeners','removeEventListener','first','hasDomSelection','remove','type','number','pin','contains','bodyCollection','clear','focus','getSidebarItemView','_showBalloon','locale','narrowSidebar','_refreshPositioning','from','context','plugins','delete','NarrowSidebar','ck-sidebar--narrow','refresh','view','activeAnnotation','narrowsidebar-detach-not-attached','low','add','attach','element','mousedown','getOrderedSelectedAnnotations','defaultPositions','register','_domEmitter','init','pluginName','annotations','change:height','set','attachToDom','_destroyEditorAnnotationsIntegration','isAttached','detachFromDom','keyCode','bind','_integrateWithEditorAnnotations','balloonPanelView','values','_hideBalloon','uiUpdate','isDirty','includes','_refreshPositioningDebounced','execute','southArrowNorth','listenTo','set:container','blur','_selectedAnnotations','has','getByView','editors','high','EditorAnnotations','addEventListener','ready','_detachListeners','requires','_updateBalloonPosition','length','_manuallyClosedAnnotationViews','_annotationToNarrowView','stopListening','setActiveAnnotation','destroy','detach','northArrowSouthWest','stopPropagation','southArrowNorthWest','_editorAnnotations','get','content','preventClosingBalloon','stop','_setSelectedAnnotations','cancel','addAnnotation','_detachFromContainer'];(function(_0x4d6ab8,_0xf1a514){const _0x3346f2=function(_0x346c51){while(--_0x346c51){_0x4d6ab8['push'](_0x4d6ab8['shift']());}};_0x3346f2(++_0xf1a514);}(_0xf1a5,0x1a9));const _0x3346=function(_0x4d6ab8,_0xf1a514){_0x4d6ab8=_0x4d6ab8-0x0;let _0x3346f2=_0xf1a5[_0x4d6ab8];return _0x3346f2;};import{ContextPlugin as _0x51169e,Context as _0x5eb9f2}from'ckeditor5/src/core';import _0x3b4002 from'./annotationsuis';import _0x13221d from'./sidebar';import _0x468537 from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x5f4f46,BodyCollection as _0xaef4b7}from'ckeditor5/src/ui';import{CKEditorError as _0x5dea2b,DomEmitterMixin as _0x28608b,keyCodes as _0xa79bef,Collection as _0x320e86}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x561547}from'lodash-es';import _0x3a17d2 from'./editorannotations';export default class s extends _0x51169e{static get[_0x3346('0x9')](){return[_0x13221d,_0x3b4002];}static get[_0x3346('0x44')](){return _0x3346('0x34');}constructor(_0x447f7f){super(_0x447f7f),this[_0x3346('0x4a')]=!0x1,this[_0x3346('0xc')]=new Set(),this[_0x3346('0x42')]=Object['create'](_0x28608b),this[_0x3346('0xd')]=new Map(),this[_0x3346('0x47')]('activeAnnotation',null),this[_0x3346('0x45')]=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x320e86(),this[_0x3346('0x55')]=_0x561547(()=>{this[_0x3346('0x2f')]();},0xfa,{'leading':!0x1});}[_0x3346('0x43')](){this[_0x3346('0x31')][_0x3346('0x32')]['get'](_0x3b4002)[_0x3346('0x41')](_0x3346('0x2e'),this),this[_0x3346('0x28')]=new _0xaef4b7(this['context'][_0x3346('0x2d')]),this['balloonPanelView']=new _0x5f4f46(this[_0x3346('0x31')][_0x3346('0x2d')]),this[_0x3346('0x28')][_0x3346('0x48')](),this[_0x3346('0x28')][_0x3346('0x3b')](this['balloonPanelView']);}[_0x3346('0x3c')](_0x27cfcd){this[_0x3346('0x45')]=_0x27cfcd;const _0x11f09f=this[_0x3346('0x31')][_0x3346('0x32')][_0x3346('0x16')](_0x13221d),_0x5eb279=this[_0x3346('0x4f')];if(_0x11f09f['_annotations']=_0x27cfcd,this['isAttached'])throw new _0x5dea2b('narrowsidebar-attach-already-attached',this);this[_0x3346('0x4a')]=!0x0,this[_0x3346('0x58')](_0x11f09f,_0x3346('0x59'),()=>{this[_0x3346('0x11')](),this[_0x3346('0x58')](_0x11f09f,'change:container',_0x5a6ccb=>{_0x5a6ccb['off'](),this[_0x3346('0x3c')](_0x27cfcd);});}),_0x11f09f['_attachToContainer']({'viewClass':_0x3346('0x35'),'spaceBetweenItems':0x5});const _0x5ec1e7=_0x274204=>{const _0x599fb9=new _0x468537(this[_0x3346('0x31')][_0x3346('0x2d')]);_0x11f09f[_0x3346('0x1c')](_0x274204,_0x599fb9),this['_annotationToNarrowView']['set'](_0x274204,_0x599fb9),_0x599fb9[_0x3346('0x4d')](_0x3346('0x53'),'annotationType',_0x3346('0x25'))['to'](_0x274204[_0x3346('0x37')],_0x3346('0x53'),_0x3346('0x24'),_0x3346('0xb')),_0x599fb9['on'](_0x3346('0x56'),()=>{this[_0x3346('0xc')][_0x3346('0x29')](),_0x5eb279[_0x3346('0x17')]['first']!==_0x274204['view']?(this[_0x3346('0x2c')](_0x274204),_0x274204['view'][_0x3346('0x3d')][_0x3346('0x2a')](),this[_0x3346('0xf')](_0x274204)):this[_0x3346('0xf')](null);});};for(const _0x565ea7 of _0x27cfcd)_0x5ec1e7(_0x565ea7);this['listenTo'](_0x27cfcd,_0x3346('0x3b'),(_0x37ebeb,_0x3e1b39)=>{_0x5ec1e7(_0x3e1b39);}),this['listenTo'](_0x27cfcd,'remove',(_0x2b23b8,_0x53a475,_0x54a3e9)=>{this[_0x3346('0xd')][_0x3346('0x16')](_0x53a475)[_0x3346('0x10')](),this['_annotationToNarrowView'][_0x3346('0x33')](_0x53a475),_0x11f09f['rearrange']({'removedAnnotation':_0x53a475,'previousAnnotation':_0x27cfcd[_0x3346('0x16')](_0x54a3e9-0x1),'nextAnnotation':_0x27cfcd[_0x3346('0x16')](_0x54a3e9+0x1)}),_0x53a475===this['activeAnnotation']&&this[_0x3346('0xf')](null);},{'priority':_0x3346('0x3a')}),this[_0x3346('0x58')](_0x27cfcd,_0x3346('0x2a'),(_0x51a874,_0x94fb53)=>{this['setActiveAnnotation'](_0x94fb53);}),this[_0x3346('0x58')](_0x27cfcd,_0x3346('0x5a'),()=>{this[_0x3346('0xf')](null);}),this[_0x3346('0x42')][_0x3346('0x58')](document,'keydown',(_0x40a3cd,_0x1c31d5)=>{_0x1c31d5[_0x3346('0x4c')]===_0xa79bef['esc']&&_0x5eb279[_0x3346('0x1e')]&&(this[_0x3346('0xc')][_0x3346('0x3b')](_0x5eb279['content'][_0x3346('0x21')]),this[_0x3346('0x51')](),_0x1c31d5[_0x3346('0x13')](),_0x1c31d5['preventDefault']());}),this[_0x3346('0x42')]['listenTo'](document,'mousedown',(_0xea4234,_0xb75954)=>{const _0x158373=_0xb75954['target'];_0x5eb279[_0x3346('0x1e')]&&_0x5eb279[_0x3346('0x3d')][_0x3346('0x27')](_0x158373)||_0x11f09f[_0x3346('0x37')][_0x3346('0x3d')][_0x3346('0x27')](_0x158373)||_0xea4234[_0x3346('0x18')]||(this['_manuallyClosedAnnotationViews'][_0x3346('0x29')](),this[_0x3346('0x51')](),this['setActiveAnnotation'](null));});const _0x566047=this[_0x3346('0x31')]instanceof _0x5eb9f2?this[_0x3346('0x31')][_0x3346('0x3')]:new _0x320e86([this[_0x3346('0x31')]]);for(const _0x40c36b of _0x566047)this['_integrateWithEditorAnnotations'](_0x40c36b);this[_0x3346('0x58')](_0x566047,_0x3346('0x3b'),(_0x50a555,_0x5cc3f7)=>{this['listenTo'](_0x5cc3f7,_0x3346('0x7'),()=>{this[_0x3346('0x4e')](_0x5cc3f7);});}),this[_0x3346('0x58')](_0x566047,_0x3346('0x23'),(_0x34c4e3,_0x339e28)=>{_0x339e28[_0x3346('0x32')][_0x3346('0x1')]('EditorAnnotations')&&this[_0x3346('0x49')](_0x339e28[_0x3346('0x32')][_0x3346('0x16')](_0x3346('0x5')));}),window[_0x3346('0x6')]('resize',this[_0x3346('0x55')]),this[_0x3346('0x2f')]();}[_0x3346('0xf')](_0x58aaf3){if(_0x58aaf3===this[_0x3346('0x38')])return;const _0x362ecf=this[_0x3346('0x31')][_0x3346('0x32')][_0x3346('0x16')](_0x13221d);if(_0x362ecf[_0x3346('0x36')]({'blurredAnnotation':this[_0x3346('0x38')],'activatedAnnotation':_0x58aaf3,'disableAnimationOnActivatedAnnotation':!0x0}),_0x58aaf3)_0x362ecf[_0x3346('0x2b')](_0x58aaf3)?this[_0x3346('0x2c')](_0x58aaf3):this[_0x3346('0x51')]();else this[_0x3346('0x51')]();this[_0x3346('0x38')]=_0x58aaf3;}[_0x3346('0x11')](){if(!this[_0x3346('0x4a')])throw new _0x5dea2b(_0x3346('0x39'),this);this[_0x3346('0xf')](null);const _0x5219ec=this[_0x3346('0x31')]['plugins'][_0x3346('0x16')](_0x13221d);this[_0x3346('0x51')](),Array[_0x3346('0x30')](this[_0x3346('0xd')][_0x3346('0x50')](),_0x130021=>_0x130021[_0x3346('0x10')]()),this[_0x3346('0xd')][_0x3346('0x29')](),_0x5219ec[_0x3346('0x1d')](this[_0x3346('0x45')]),this['stopListening'](),this[_0x3346('0x42')][_0x3346('0xe')](),this[_0x3346('0x31')]instanceof _0x5eb9f2&&this[_0x3346('0xe')](this[_0x3346('0x31')]['editors']);for(const _0x19cdba of Array[_0x3346('0x30')](this[_0x3346('0x15')]))this['_destroyEditorAnnotationsIntegration'](_0x19cdba);window[_0x3346('0x20')]('resize',this[_0x3346('0x55')]),this[_0x3346('0x55')][_0x3346('0x1b')](),this[_0x3346('0x0')]=[],this[_0x3346('0x4a')]=!0x1,this['annotations']=null;}[_0x3346('0x10')](){this['isAttached']&&this[_0x3346('0x11')](),this[_0x3346('0x28')][_0x3346('0x4b')]();}[_0x3346('0x4e')](_0x3157c7){const _0x390853=_0x3157c7[_0x3346('0x32')][_0x3346('0x16')](_0x3a17d2),_0x3db0b7=this['context'][_0x3346('0x32')][_0x3346('0x16')](_0x13221d),_0x5a7f0a=this[_0x3346('0x45')],_0x577618=this[_0x3346('0x4f')],_0x41ee17=()=>{const _0x6e0a91=_0x390853[_0x3346('0x3f')]({'annotations':this[_0x3346('0x45')],'activeAnnotation':this[_0x3346('0x38')]});this[_0x3346('0x1a')](_0x6e0a91),this[_0x3346('0xf')](_0x6e0a91[0x0]||null);};this[_0x3346('0x58')](_0x390853,'refresh',_0x41ee17),this['listenTo'](_0x390853,_0x3346('0x5a'),(_0x17ff91,{isAnnotationTracked:_0x54f99b})=>{this['activeAnnotation']&&_0x54f99b(this[_0x3346('0x38')])&&(this[_0x3346('0x1a')]([]),this[_0x3346('0xf')](null));}),this['listenTo'](_0x390853,_0x3346('0x52'),()=>{this[_0x3346('0x55')]();}),this[_0x3346('0x58')](_0x5a7f0a,_0x3346('0x5a'),_0x1c031f=>{_0x390853[_0x3346('0x22')]()&&_0x1c031f[_0x3346('0x19')]();},{'priority':_0x3346('0x4')}),this[_0x3346('0x58')](this[_0x3346('0x42')],_0x3346('0x3e'),(_0x259217,_0xd435b7)=>{const _0xa6611e=_0xd435b7['target'];_0x577618[_0x3346('0x1e')]&&_0x577618[_0x3346('0x3d')][_0x3346('0x27')](_0xa6611e)||_0x3db0b7['view'][_0x3346('0x3d')][_0x3346('0x27')](_0xa6611e)||this[_0x3346('0x38')]&&_0x390853[_0x3346('0x22')]()&&(_0x41ee17(),_0x259217[_0x3346('0x18')]=!0x0);},{'priority':'high'}),this['_editorAnnotations'][_0x3346('0x3b')](_0x390853);}[_0x3346('0x49')](_0x1afff0){_0x1afff0&&(this[_0x3346('0xe')](_0x1afff0),this[_0x3346('0x15')]['remove'](_0x1afff0));}[_0x3346('0x1a')](_0x2f8728){for(const _0x4df9e1 of this[_0x3346('0x0')])_0x2f8728[_0x3346('0x54')](_0x4df9e1)||this[_0x3346('0xc')][_0x3346('0x33')](_0x4df9e1['view']);this[_0x3346('0x0')]=_0x2f8728;}[_0x3346('0x2f')](){const _0x3c3ed3=this[_0x3346('0x4f')];this['annotations']['refreshPositioning'](),_0x3c3ed3['isVisible']&&this[_0x3346('0xa')]();}['_showBalloon'](_0x2d21e0){if(this['_manuallyClosedAnnotationViews'][_0x3346('0x1')](_0x2d21e0[_0x3346('0x37')]))return;const _0x4bbfba=this[_0x3346('0x4f')][_0x3346('0x17')]['first'];_0x4bbfba!==_0x2d21e0[_0x3346('0x37')]?(_0x4bbfba&&this[_0x3346('0x8')](_0x4bbfba),this[_0x3346('0x1f')](_0x2d21e0['view']),this[_0x3346('0x4f')][_0x3346('0x17')]['clear'](),this[_0x3346('0x4f')][_0x3346('0x17')]['add'](_0x2d21e0[_0x3346('0x37')]),this[_0x3346('0xa')]()):this[_0x3346('0xa')]();}['_updateBalloonPosition'](){const _0x2f1804=this['balloonPanelView'][_0x3346('0x17')][_0x3346('0x21')],_0x1e4b8a=_0x2f1804&&this[_0x3346('0x45')][_0x3346('0x2')](_0x2f1804);if(!_0x1e4b8a||!this[_0x3346('0xd')][_0x3346('0x1')](_0x1e4b8a))return;const _0x2a9cf4=this[_0x3346('0xd')][_0x3346('0x16')](_0x1e4b8a)[_0x3346('0x3d')],_0x44fa14=function(){const _0x2d6b82=_0x5f4f46[_0x3346('0x40')];return[_0x2d6b82['southArrowNorthEast'],_0x2d6b82['northArrowSouthEast'],_0x2d6b82[_0x3346('0x57')],_0x2d6b82['northArrowSouth'],_0x2d6b82[_0x3346('0x14')],_0x2d6b82[_0x3346('0x12')]];}();this[_0x3346('0x4f')][_0x3346('0x26')]({'target':_0x2a9cf4,'positions':_0x44fa14});}[_0x3346('0x51')](){const _0x55dfbc=this['balloonPanelView'],_0x14b797=_0x55dfbc[_0x3346('0x17')][_0x3346('0x21')];_0x14b797&&(this['_detachListeners'](_0x14b797),_0x55dfbc['unpin'](),_0x55dfbc[_0x3346('0x17')][_0x3346('0x29')]());}[_0x3346('0x1f')](_0x563ba9){this[_0x3346('0x58')](_0x563ba9,_0x3346('0x46'),()=>this['_updateBalloonPosition']()),this[_0x3346('0x58')](_0x563ba9,'Esc',(_0x5ac788,_0x33a122)=>{this['_manuallyClosedAnnotationViews'][_0x3346('0x3b')](_0x563ba9),this[_0x3346('0x51')](),_0x33a122();});}[_0x3346('0x8')](_0x5f16a2){this[_0x3346('0xe')](_0x5f16a2);}}
|
|
@@ -0,0 +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(): '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 _0xbd5d=['delete','_getTargetTop','stopListening','locale','isActive','_alignBeforeItem','_alignForBottomChange','last','content','getIndex','_alignToTargetRect','nodeType','clear','setContainer','unbind','_annotationToSidebarItemView','Sidebar','config','get','length','define','sidebar-setcontainer-invalid-element','remove','_setItemTop','change:bottom','change:targetRect','_recalculate','object','top','listenTo','_alignAfterItem','render','_spaceBetweenItems','_alignForTopChange','view','minHeight','pluginName','destroy','_createSidebarView','_getItemAfter','class','bottom','refresh','sidebar.preventScrollOutOfView','max','_targetTop','_annotations','_recalculateBuffer','_updateLastItem','_destroySidebarItemView','_detachFromContainer','context','getSidebarItemView','add','_getItemBefore','updateHeight','isAnimationDisabled','_sidebarItemViewToAnnotation','_lastItem','list','target','set','push','change:_lastItem','element','_attachToContainer','container','targetRect','_activeAnnotation'];(function(_0x4a9325,_0xbd5d8){const _0x14d88b=function(_0x54d536){while(--_0x54d536){_0x4a9325['push'](_0x4a9325['shift']());}};_0x14d88b(++_0xbd5d8);}(_0xbd5d,0x19d));const _0x14d8=function(_0x4a9325,_0xbd5d8){_0x4a9325=_0x4a9325-0x0;let _0x14d88b=_0xbd5d[_0x4a9325];return _0x14d88b;};import{ContextPlugin as _0xef7107}from'ckeditor5/src/core';import{Rect as _0x30d9b3,CKEditorError as _0xca2795}from'ckeditor5/src/utils';import _0x4a422e from'./view/sidebarview';import _0x1db480 from'./view/sidebaritemview';export default class z extends _0xef7107{static get[_0x14d8('0x25')](){return _0x14d8('0x11');}constructor(_0xe5be3d){super(_0xe5be3d),this[_0x14d8('0x3e')]('_lastItem',void 0x0),this['view']=this[_0x14d8('0x27')](),this[_0x14d8('0x3e')]('container',null),this[_0x14d8('0x21')]=0x19,this[_0x14d8('0x3a')]=new Map(),this[_0x14d8('0x10')]=new Map(),this['context'][_0x14d8('0x12')][_0x14d8('0x15')](_0x14d8('0x2c'),!0x1),this[_0x14d8('0x2f')]=null,this['_activeAnnotation']=null,this[_0x14d8('0x30')]=[];}['init'](){const _0x2fd00d=this[_0x14d8('0x34')][_0x14d8('0x12')][_0x14d8('0x13')]('sidebar.container');_0x2fd00d&&this[_0x14d8('0xe')](_0x2fd00d);}[_0x14d8('0xe')](_0x4d36dd){if(!y(_0x4d36dd))throw new _0xca2795(_0x14d8('0x16'));this[_0x14d8('0x43')]=_0x4d36dd;}[_0x14d8('0x42')]({viewClass:_0x447006='',spaceBetweenItems:_0x2ba89e=0x19}={}){if(!y(this[_0x14d8('0x43')]))throw new _0xca2795('sidebar-attachtocontainer-missing-container',this);this[_0x14d8('0x43')]['appendChild'](this[_0x14d8('0x23')][_0x14d8('0x41')]),this[_0x14d8('0x23')]['class']=_0x447006,this[_0x14d8('0x21')]=_0x2ba89e;}['rearrange']({removedAnnotation:_0x412676,previousAnnotation:_0x50e618,nextAnnotation:_0x1638b6}){const _0x34a101=this[_0x14d8('0x35')](_0x412676);this[_0x14d8('0x23')]['list'][_0x14d8('0x17')](_0x34a101),this[_0x14d8('0x32')](_0x412676),_0x50e618&&this[_0x14d8('0xb')](this[_0x14d8('0x35')](_0x50e618)),_0x1638b6&&this[_0x14d8('0xb')](this[_0x14d8('0x35')](_0x1638b6)),this[_0x14d8('0x31')]();}[_0x14d8('0x2b')]({blurredAnnotation:_0x570d68,activatedAnnotation:_0x43a822,disableAnimationOnActivatedAnnotation:_0x59a75c}){if(this[_0x14d8('0x0')]=_0x43a822,_0x570d68){_0x570d68['isActive']=!0x1;const _0x190622=this['getSidebarItemView'](_0x570d68);_0x190622&&_0x59a75c&&(_0x190622['isAnimationDisabled']=!0x1);}if(_0x43a822){const _0x576e3c=this[_0x14d8('0x35')](_0x43a822);_0x576e3c&&(_0x43a822[_0x14d8('0x5')]=!0x0,_0x59a75c&&(_0x576e3c[_0x14d8('0x39')]=!0x0,_0x576e3c[_0x14d8('0x1d')]+=0x1),this['_alignToTargetRect'](_0x576e3c));}}[_0x14d8('0x33')](_0x3f9a16){if(this['stopListening'](),this['view'][_0x14d8('0x41')][_0x14d8('0x17')](),_0x3f9a16)for(const _0x15cc7a of _0x3f9a16)this[_0x14d8('0x32')](_0x15cc7a);this['view']['list'][_0x14d8('0xd')](),this[_0x14d8('0x23')][_0x14d8('0x29')]='',this[_0x14d8('0x3b')]=null;}['addAnnotation'](_0x56a015,_0xf4e334){_0xf4e334||(_0xf4e334=_0x56a015[_0x14d8('0x23')]);const _0x459661=new _0x1db480(this[_0x14d8('0x34')]['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x459661,_0x56a015),this[_0x14d8('0x10')][_0x14d8('0x3e')](_0x56a015,_0x459661),_0x459661['content']['add'](_0xf4e334),this[_0x14d8('0x1e')](_0x56a015['view'],_0x14d8('0x1a'),(_0x8364bd,_0x4f6e0d,_0x10eb5b)=>{const _0x45b755=this[_0x14d8('0x2')](_0x56a015,_0x10eb5b);_0x459661[_0x14d8('0x2e')]!=_0x45b755&&(_0x459661[_0x14d8('0x2e')]=_0x45b755,this[_0x14d8('0x18')](_0x459661,_0x45b755));}),this[_0x14d8('0x1e')](_0x459661,'change:top',()=>{this[_0x14d8('0x1b')](_0x459661,_0x14d8('0x1d'));}),this[_0x14d8('0x1e')](_0x459661,_0x14d8('0x19'),()=>{this[_0x14d8('0x1b')](_0x459661,_0x14d8('0x2a'));}),this[_0x14d8('0xb')](_0x459661);const _0x447642=this[_0x14d8('0x37')](_0x459661);if(_0x447642)this[_0x14d8('0x1f')](_0x447642,_0x459661)||this['_alignToTargetRect'](_0x459661);else this[_0x14d8('0xb')](_0x459661);return this[_0x14d8('0x31')](),this[_0x14d8('0x23')][_0x14d8('0x3c')][_0x14d8('0x36')](_0x459661),_0x459661;}[_0x14d8('0x22')](_0x1877d5){if(!_0x1877d5[_0x14d8('0x9')][_0x14d8('0x14')])return;const _0x574c75=this[_0x14d8('0x37')](_0x1877d5);if(!_0x574c75)return;const _0xcb8a97=this[_0x14d8('0x3a')][_0x14d8('0x13')](_0x574c75),_0x12e153=this['_activeAnnotation'];_0x12e153&&_0x12e153===_0xcb8a97?this[_0x14d8('0x1f')](_0x574c75,_0x1877d5):this[_0x14d8('0x6')](_0x1877d5,_0x574c75);}[_0x14d8('0x7')](_0x2c500b){if(!_0x2c500b['content'][_0x14d8('0x14')])return;const _0x1f5de9=this[_0x14d8('0x28')](_0x2c500b);if(!_0x1f5de9)return;const _0x3a5455=this['_sidebarItemViewToAnnotation'][_0x14d8('0x13')](_0x1f5de9),_0x14724d=this[_0x14d8('0x34')][_0x14d8('0x12')][_0x14d8('0x13')](_0x14d8('0x2c')),_0x439104=this[_0x14d8('0x0')];_0x439104&&_0x439104===_0x3a5455&&_0x14724d?(this['_alignBeforeItem'](_0x1f5de9,_0x2c500b),this[_0x14d8('0x1f')](_0x2c500b,_0x1f5de9)):_0x439104&&_0x439104===_0x3a5455?this[_0x14d8('0x6')](_0x1f5de9,_0x2c500b):this[_0x14d8('0x1f')](_0x2c500b,_0x1f5de9);}[_0x14d8('0x1b')](_0x5c4fdb,_0x2a5b03){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x5b8a14,changedProp:_0x1dfcf1}of this[_0x14d8('0x30')])_0x14d8('0x1d')===_0x1dfcf1?this[_0x14d8('0x22')](_0x5b8a14):this[_0x14d8('0x7')](_0x5b8a14);this[_0x14d8('0x30')]=[];},0xa),this['_recalculateBuffer'][_0x14d8('0x3f')]({'sidebarItemView':_0x5c4fdb,'changedProp':_0x2a5b03});}['getSidebarItemView'](_0x580f38){return this[_0x14d8('0x10')][_0x14d8('0x13')](_0x580f38);}[_0x14d8('0x26')](){this['view'][_0x14d8('0x26')]();}[_0x14d8('0x32')](_0x385b81){const _0x4048e6=this[_0x14d8('0x35')](_0x385b81);this[_0x14d8('0x3')](_0x4048e6),this[_0x14d8('0x3')](_0x385b81[_0x14d8('0x23')]),_0x4048e6['destroy'](),this['_annotationToSidebarItemView'][_0x14d8('0x1')](_0x385b81),this[_0x14d8('0x3a')][_0x14d8('0x1')](_0x4048e6);}[_0x14d8('0x27')](){const _0x201b3c=new _0x4a422e(this[_0x14d8('0x34')][_0x14d8('0x4')]);return _0x201b3c[_0x14d8('0x20')](),this['on'](_0x14d8('0x40'),(_0x34b593,_0x1a6445,_0x98b80e,_0x29a2e2)=>{_0x29a2e2&&_0x201b3c[_0x14d8('0xf')](_0x14d8('0x24')),_0x98b80e?_0x201b3c['bind']('minHeight')['to'](_0x98b80e,_0x14d8('0x2a')):_0x201b3c[_0x14d8('0x24')]=null;}),_0x201b3c;}[_0x14d8('0x31')](){var _0x516dec;this['_lastItem']=(null===(_0x516dec=this['_annotations'])||void 0x0===_0x516dec?void 0x0:_0x516dec['last'])?this['getSidebarItemView'](this[_0x14d8('0x2f')][_0x14d8('0x8')]):null;}[_0x14d8('0x37')](_0x806b7c){var _0x19db0d;const _0x197a15=this['_sidebarItemViewToAnnotation'][_0x14d8('0x13')](_0x806b7c),_0x582f31=_0x197a15&&(null===(_0x19db0d=this[_0x14d8('0x2f')])||void 0x0===_0x19db0d?void 0x0:_0x19db0d[_0x14d8('0x13')](this[_0x14d8('0x2f')]['getIndex'](_0x197a15)-0x1));return _0x582f31&&this[_0x14d8('0x35')](_0x582f31)||null;}[_0x14d8('0x28')](_0x30d1bf){var _0x13b31e;const _0xca86d1=this[_0x14d8('0x3a')][_0x14d8('0x13')](_0x30d1bf),_0x5799d1=_0xca86d1&&(null===(_0x13b31e=this[_0x14d8('0x2f')])||void 0x0===_0x13b31e?void 0x0:_0x13b31e['get'](this[_0x14d8('0x2f')][_0x14d8('0xa')](_0xca86d1)+0x1));return _0x5799d1&&this[_0x14d8('0x35')](_0x5799d1)||null;}[_0x14d8('0x6')](_0x3ae9fc,_0x545cbf){_0x3ae9fc[_0x14d8('0x38')]();const _0x5c83b3=H(_0x545cbf[_0x14d8('0x2a')]+this[_0x14d8('0x21')],_0x3ae9fc[_0x14d8('0x1d')]);return!!_0x5c83b3&&(this[_0x14d8('0x18')](_0x545cbf,_0x545cbf[_0x14d8('0x1d')]-_0x5c83b3),!0x0);}[_0x14d8('0x1f')](_0x2814bf,_0x1320be){_0x2814bf[_0x14d8('0x38')]();const _0x2a4515=H(_0x2814bf[_0x14d8('0x2a')]+this[_0x14d8('0x21')],_0x1320be[_0x14d8('0x1d')]);return!!_0x2a4515&&(this[_0x14d8('0x18')](_0x1320be,_0x1320be['top']+_0x2a4515,!0x1),!0x0);}[_0x14d8('0xb')](_0x409e24){const _0xe35952=this[_0x14d8('0x3a')][_0x14d8('0x13')](_0x409e24);if(!_0xe35952||!_0xe35952[_0x14d8('0x3d')]||!_0xe35952[_0x14d8('0x44')])return;const _0x4cb9f5=this[_0x14d8('0x2')](_0xe35952,_0xe35952[_0x14d8('0x44')]);this[_0x14d8('0x18')](_0x409e24,_0x4cb9f5);}[_0x14d8('0x2')](_0x15c49a,_0x3d7278){if(null===_0x3d7278)return 0x0;if(_0x15c49a['target']instanceof _0x30d9b3)return _0x3d7278[_0x14d8('0x1d')];{const _0xa8f39=new _0x30d9b3(this[_0x14d8('0x23')][_0x14d8('0x41')])['top'];return _0x3d7278[_0x14d8('0x1d')]-_0xa8f39;}}[_0x14d8('0x18')](_0x2e695d,_0x18f6b7,_0x198954=this[_0x14d8('0x34')][_0x14d8('0x12')]['get'](_0x14d8('0x2c'))){_0x198954&&(_0x18f6b7=Math[_0x14d8('0x2d')](_0x18f6b7,this['_getMaxAvailableTop'](_0x2e695d))),_0x2e695d[_0x14d8('0x1d')]=_0x18f6b7;}['_getMaxAvailableTop'](_0x15bb19){let _0x5145c9=this[_0x14d8('0x37')](_0x15bb19),_0x41aff7=0x0;for(;_0x5145c9;)_0x5145c9[_0x14d8('0x38')](),_0x41aff7+=this['_spaceBetweenItems']+_0x5145c9['height'],_0x5145c9=this[_0x14d8('0x37')](_0x5145c9);return _0x41aff7;}}function H(_0x658b14,_0x57338f){return Math['max'](_0x658b14-_0x57338f,0x0);}function y(_0x604390){return null!==_0x604390&&_0x14d8('0x1c')==typeof _0x604390&&0x1===_0x604390[_0x14d8('0xc')];}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5f4c=['toString','counterView','span','icon','isDirty','_badge','ck-annotation-counter__badge','set','ck-annotation-counter__badge--','bindTemplate','add','ck-annotation-counter__badge--edit-mode','setTemplate','annotationType','extendTemplate'];(function(_0x23877a,_0x5f4c58){const _0x5641c8=function(_0x56b465){while(--_0x56b465){_0x23877a['push'](_0x23877a['shift']());}};_0x5641c8(++_0x5f4c58);}(_0x5f4c,0xf9));const _0x5641=function(_0x23877a,_0x5f4c58){_0x23877a=_0x23877a-0x0;let _0x5641c8=_0x5f4c[_0x23877a];return _0x5641c8;};import{ButtonView as _0x11b5a2,View as _0x3668e7}from'ckeditor5/src/ui';import _0x110ac7 from'../../../theme/icons/add-comment.svg';export default class D extends _0x11b5a2{constructor(_0x13e2d5){super(_0x13e2d5);const _0x5a024f=this[_0x5641('0x0')];this[_0x5641('0xd')](_0x5641('0xa'),!0x1),this['set']('number',0x0),this['bind'](_0x5641('0xb'))['to'](this,'isDirty',this,'number',(_0x7c034,_0x48f9e8)=>_0x7c034?'...':_0x48f9e8[_0x5641('0x6')]()),this[_0x5641('0xd')](_0x5641('0x4'),''),this[_0x5641('0x9')]=_0x110ac7,this[_0x5641('0x5')]({'attributes':{'class':['ck-annotation-counter']}}),this[_0x5641('0x7')]=new _0x3668e7(),this[_0x5641('0x7')][_0x5641('0x3')]({'tag':_0x5641('0x8'),'attributes':{'class':[_0x5641('0xc'),_0x5a024f['to'](_0x5641('0x4'),_0x412d3c=>_0x5641('0xe')+_0x412d3c),_0x5a024f['if'](_0x5641('0xa'),_0x5641('0x2'))]},'children':[{'text':_0x5a024f['to'](_0x5641('0xb'))}]}),this['children'][_0x5641('0x1')](this['counterView']);}}
|