@ckeditor/ckeditor5-comments 36.0.1 → 37.0.0-rc.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 _0x2d96=['isFocused','includes','bottom','plugins','from','detach','_forceRefresh','_setSelectedAnnotations','remove','clear','pluginName','fromRect','top','editing','stopListening','length','inlineannotations-not-allowed-with-context','_manuallyClosed','hasActive','set','add','afterInit','getByView','document','Esc','every','push','_closeAnnotation','getOrderedSelectedAnnotations','view','keystrokes','target','focus','get','change:visibleView','showStack','switchTo','_balloon','right','_addedAnnotations','destroy','isActive','setActiveAnnotation','isAttached','_removeAnnotationFromBalloon','editor','editableElement','addObserver','change:isFocused','change:height','activeAnnotation','getBoundingClientRect','hasView','attach','blur','annotations','focusTracker','delete','map','context','left','listenTo','targetRect','updatePosition','update','_addAnnotationToBalloon','find','collapse','_selectedAnnotations','has','getFirstRange','selection','inline','mousedown','width','visibleView'];(function(_0x296048,_0x2d9619){const _0x32011e=function(_0x51d54a){while(--_0x51d54a){_0x296048['push'](_0x296048['shift']());}};_0x32011e(++_0x2d9619);}(_0x2d96,0x111));const _0x3201=function(_0x296048,_0x2d9619){_0x296048=_0x296048-0x0;let _0x32011e=_0x2d96[_0x296048];return _0x32011e;};import{Plugin as _0x394cd1}from'ckeditor5/src/core';import _0x3b01a2 from'./annotationsuis';import _0x479de6 from'./editorannotations';import{ContextualBalloon as _0x5e56a8}from'ckeditor5/src/ui';import{MouseObserver as _0x4698d0}from'ckeditor5/src/engine';import{CKEditorError as _0x54d7de,Rect as _0x10eb49}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x394cd1{static get['requires'](){return[_0x479de6,_0x5e56a8,_0x3b01a2];}static get[_0x3201('0x29')](){return'InlineAnnotations';}constructor(_0x44a542){super(_0x44a542),_0x44a542['editing'][_0x3201('0x3c')][_0x3201('0x2')](_0x4698d0),this['isAttached']=!0x1,this[_0x3201('0x32')](_0x3201('0x5'),null),this[_0x3201('0xa')]=null,this[_0x3201('0x30')]=new Set(),this[_0x3201('0x44')]=_0x44a542[_0x3201('0x22')][_0x3201('0x40')](_0x5e56a8),this[_0x3201('0x46')]=new Set(),this['_selectedAnnotations']=[],this[_0x3201('0x25')]=!0x1;}['init'](){const _0x3f0927=this[_0x3201('0x0')][_0x3201('0x22')][_0x3201('0x40')](_0x3b01a2);_0x3f0927['context']===this[_0x3201('0x0')]&&(_0x3f0927['register']('inline',this),this['editor'][_0x3201('0x3d')][_0x3201('0x32')](_0x3201('0x37'),(_0x517c18,_0x432928)=>{const _0x6c0220=this[_0x3201('0x44')];if(this[_0x3201('0x4a')]&&_0x6c0220[_0x3201('0x1e')]){const _0x4328ce=this[_0x3201('0xa')][_0x3201('0x35')](_0x6c0220[_0x3201('0x1e')]);_0x4328ce&&this[_0x3201('0x3a')](_0x4328ce),_0x432928();}}));}[_0x3201('0x34')](){const _0x1ea787=this[_0x3201('0x0')][_0x3201('0x22')][_0x3201('0x40')](_0x3b01a2);_0x1ea787[_0x3201('0xe')]===this[_0x3201('0x0')]&&(_0x1ea787[_0x3201('0x31')]()||_0x1ea787[_0x3201('0x43')](_0x3201('0x1b')));}[_0x3201('0x49')](_0x3fb47b){_0x3fb47b!==this[_0x3201('0x5')]&&(this['activeAnnotation']&&(this[_0x3201('0x5')][_0x3201('0x48')]=!0x1),_0x3fb47b&&this[_0x3201('0x0')]['ui'][_0x3201('0xb')][_0x3201('0x1f')]&&(this[_0x3201('0xa')][_0x3201('0x18')](_0x3fb47b)&&this[_0x3201('0x14')](_0x3fb47b,!0x0),_0x3fb47b[_0x3201('0x48')]=!0x0),_0x3fb47b||this['_setSelectedAnnotations']([]),this[_0x3201('0x5')]=_0x3fb47b);}[_0x3201('0x8')](_0x433c93){this[_0x3201('0xa')]=_0x433c93;const _0x5d73ff=this['editor'][_0x3201('0x22')]['get'](_0x3b01a2),_0x21e65f=this[_0x3201('0x44')];if(this[_0x3201('0x4a')])throw new _0x54d7de('inlineannotations-attach-already-attached',this);if(_0x5d73ff[_0x3201('0xe')]!==this[_0x3201('0x0')])throw new _0x54d7de(_0x3201('0x2f'),this);const _0x18a621=this[_0x3201('0x0')][_0x3201('0x22')][_0x3201('0x40')](_0x479de6);this[_0x3201('0x10')](_0x18a621,'refresh',()=>{const _0x54285e=_0x18a621[_0x3201('0x3b')]({'annotations':this[_0x3201('0xa')],'activeAnnotation':this['activeAnnotation']});var _0x501146,_0x219b14;!this[_0x3201('0x25')]&&(_0x501146=_0x54285e,_0x219b14=this[_0x3201('0x17')],_0x501146[_0x3201('0x2e')]===_0x219b14[_0x3201('0x2e')]&&_0x501146[_0x3201('0x38')](_0x515ccb=>_0x219b14[_0x3201('0x20')](_0x515ccb)))||(this[_0x3201('0x25')]=!0x1,this[_0x3201('0x26')](_0x54285e),this[_0x3201('0x49')](_0x54285e[0x0]||null));}),this[_0x3201('0x10')](_0x18a621,_0x3201('0x9'),(_0x1ab4c8,{isAnnotationTracked:_0x1e6a7d})=>{this['activeAnnotation']&&_0x1e6a7d(this['activeAnnotation'])&&(this[_0x3201('0x26')]([]),this[_0x3201('0x49')](null));}),this[_0x3201('0x10')](this[_0x3201('0x0')]['ui'][_0x3201('0xb')],_0x3201('0x3'),(_0x389996,_0x338a40,_0x19ec67)=>{_0x19ec67||this[_0x3201('0x49')](null);}),this[_0x3201('0x10')](_0x433c93,_0x3201('0x27'),(_0x13743e,_0x23473f)=>{this[_0x3201('0x4b')](_0x23473f),_0x23473f===this[_0x3201('0x5')]&&this[_0x3201('0x49')](null);}),this[_0x3201('0x10')](_0x21e65f,_0x3201('0x41'),(_0x5773c2,_0x34ecc3,_0x23bb0b,_0x46351d)=>{_0x46351d&&this[_0x3201('0x2d')](_0x46351d);const _0x16010e=_0x433c93[_0x3201('0x35')](_0x23bb0b);_0x23bb0b&&_0x16010e&&(this['listenTo'](_0x23bb0b,_0x3201('0x4'),()=>{_0x21e65f[_0x3201('0x12')]();}),this[_0x3201('0x10')](_0x23bb0b,_0x3201('0x37'),()=>{this['_closeAnnotation'](_0x16010e),this[_0x3201('0x0')]['editing'][_0x3201('0x3c')][_0x3201('0x3f')]();}),this['activeAnnotation']!==_0x16010e&&this['setActiveAnnotation'](_0x16010e));}),this['listenTo'](this[_0x3201('0x0')]['ui'],_0x3201('0x13'),()=>{_0x21e65f[_0x3201('0x1e')]&&(_0x433c93[_0x3201('0x35')](_0x21e65f[_0x3201('0x1e')])&&_0x21e65f[_0x3201('0x12')]());}),this[_0x3201('0x10')](this[_0x3201('0x0')][_0x3201('0x2c')][_0x3201('0x3c')][_0x3201('0x36')],_0x3201('0x1c'),()=>{this[_0x3201('0x25')]=!0x0,this[_0x3201('0x30')][_0x3201('0x28')]();}),this['editor'][_0x3201('0x2c')][_0x3201('0x3c')][_0x3201('0x36')]['selection'][_0x3201('0x1')]&&this[_0x3201('0x0')][_0x3201('0x2c')][_0x3201('0x3c')][_0x3201('0x3f')](),this[_0x3201('0x4a')]=!0x0;}[_0x3201('0x24')](){if(!this[_0x3201('0x4a')])throw new _0x54d7de('inlineannotations-detach-not-attached',this);this[_0x3201('0x49')](null);for(const _0x4ba597 of this[_0x3201('0x46')])this[_0x3201('0x4b')](_0x4ba597);this[_0x3201('0x2d')](),this['isAttached']=!0x1,this[_0x3201('0xa')]=null;}[_0x3201('0x47')](){this[_0x3201('0x4a')]&&this[_0x3201('0x24')]();}[_0x3201('0x26')](_0xfdab94){for(const _0x322e8a of this[_0x3201('0x17')])_0xfdab94[_0x3201('0x20')](_0x322e8a)||this[_0x3201('0x30')][_0x3201('0xc')](_0x322e8a);for(const _0x7a9093 of this[_0x3201('0xa')])_0xfdab94[_0x3201('0x20')](_0x7a9093)||this['_removeAnnotationFromBalloon'](_0x7a9093);if(this['editor']['ui'][_0x3201('0xb')][_0x3201('0x1f')])for(const _0x180cee of _0xfdab94)this[_0x3201('0x14')](_0x180cee);this[_0x3201('0x17')]=_0xfdab94;}[_0x3201('0x14')](_0x3c77af,_0x23667d=!0x1){this[_0x3201('0x30')][_0x3201('0x18')](_0x3c77af)||(this[_0x3201('0x46')][_0x3201('0x18')](_0x3c77af)||this[_0x3201('0x44')][_0x3201('0x7')](_0x3c77af[_0x3201('0x3c')])||(this['_addedAnnotations'][_0x3201('0x33')](_0x3c77af),this['_balloon'][_0x3201('0x33')]({'stackId':_0x3c77af[_0x3201('0x3c')]['id'],'view':_0x3c77af[_0x3201('0x3c')],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x3c77af)}})),_0x23667d&&this[_0x3201('0x44')][_0x3201('0x42')](_0x3c77af[_0x3201('0x3c')]['id']));}['_getBalloonTargetForAnnotation'](_0x5965fc){const _0x4f214f=_0x5965fc[_0x3201('0x3e')],_0x2387ca=this[_0x3201('0x0')][_0x3201('0x2c')]['view'],_0x359026=_0x2387ca[_0x3201('0x36')][_0x3201('0x1a')][_0x3201('0x19')](),_0x573f69=_0x2387ca['domConverter']['viewRangeToDom'](_0x359026);if(_0x573f69[_0x3201('0x16')](!0x0),_0x4f214f){if(_0x4f214f instanceof _0x10eb49)return _0x4f214f;let _0x2f1c66=[];for(const _0x2d46dc of _0x4f214f)_0x2f1c66['push'](...(_0x559d59=_0x2d46dc['getClientRects'](),Array[_0x3201('0x23')](_0x559d59)[_0x3201('0xd')](DOMRect[_0x3201('0x2a')])));_0x2f1c66=function(_0x17a82f){const _0x46a5f4=[];let _0x58e408=_0x17a82f[0x0];for(let _0x4966c=0x1;_0x4966c<_0x17a82f[_0x3201('0x2e')];_0x4966c++)F(_0x58e408,_0x17a82f[_0x4966c])?_0x58e408[_0x3201('0x1d')]+=_0x17a82f[_0x4966c][_0x3201('0x1d')]:(_0x46a5f4['push'](_0x58e408),_0x58e408=_0x17a82f[_0x4966c]);return _0x46a5f4[_0x3201('0x39')](_0x58e408),_0x46a5f4;}(_0x2f1c66);const _0x4b6b55=_0x573f69[_0x3201('0x6')]();return _0x2f1c66[_0x3201('0x15')](_0x36539f=>_0x36539f[_0x3201('0x2b')]<=_0x4b6b55[_0x3201('0x2b')]&&_0x36539f[_0x3201('0x21')]>=_0x4b6b55[_0x3201('0x21')]&&_0x36539f['left']<=_0x4b6b55[_0x3201('0xf')]&&_0x36539f[_0x3201('0x45')]>=_0x4b6b55[_0x3201('0x45')])||_0x2f1c66[0x0];}var _0x559d59;return _0x5965fc[_0x3201('0x11')]||_0x573f69;}[_0x3201('0x4b')](_0x5a23d9){this[_0x3201('0x46')][_0x3201('0x18')](_0x5a23d9)&&this[_0x3201('0x44')][_0x3201('0x7')](_0x5a23d9[_0x3201('0x3c')])&&(this[_0x3201('0x46')][_0x3201('0xc')](_0x5a23d9),this[_0x3201('0x44')][_0x3201('0x27')](_0x5a23d9[_0x3201('0x3c')]));}[_0x3201('0x3a')](_0x5a90d1){this[_0x3201('0x30')][_0x3201('0x33')](_0x5a90d1),this['_removeAnnotationFromBalloon'](_0x5a90d1);}}function F(_0x229ac4,_0xfee924){return _0x229ac4[_0x3201('0x2b')]===_0xfee924[_0x3201('0x2b')]&&_0x229ac4[_0x3201('0x21')]===_0xfee924[_0x3201('0x21')]&&_0x229ac4[_0x3201('0x45')]===_0xfee924['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 _0x297b=['isAttached','bodyCollection','_integrateWithEditorAnnotations','_attachListeners','length','target','esc','pluginName','requires','type','narrowsidebar-attach-already-attached','from','annotationType','removeEventListener','NarrowSidebar','set:container','context','defaultPositions','blur','getSidebarItemView','hasDomSelection','isVisible','keyCode','add','_selectedAnnotations','getOrderedSelectedAnnotations','remove','rearrange','refreshPositioning','northArrowSouthWest','clear','southArrowNorthEast','content','getByView','delete','_hideBalloon','view','keydown','stop','editors','contains','_showBalloon','addAnnotation','annotations','setActiveAnnotation','_detachFromContainer','focus','_editorAnnotations','get','register','ck-sidebar--narrow','_setSelectedAnnotations','refresh','locale','includes','_annotations','EditorAnnotations','stopListening','create','listenTo','uiUpdate','_destroyEditorAnnotationsIntegration','preventClosingBalloon','detach','_updateBalloonPosition','southArrowNorthWest','_refreshPositioning','_detachListeners','init','southArrowNorth','element','attachToDom','first','isDirty','mousedown','low','activeAnnotation','execute','has','attach','destroy','pin','resize','plugins','balloonPanelView','_manuallyClosedAnnotationViews','Esc','_annotationToNarrowView','detachFromDom','northArrowSouthEast','high','_refreshPositioningDebounced','cancel','change:container','_domEmitter','set','unpin'];(function(_0x2bf93c,_0x297b41){const _0x11598d=function(_0x16fa33){while(--_0x16fa33){_0x2bf93c['push'](_0x2bf93c['shift']());}};_0x11598d(++_0x297b41);}(_0x297b,0x6f));const _0x1159=function(_0x2bf93c,_0x297b41){_0x2bf93c=_0x2bf93c-0x0;let _0x11598d=_0x297b[_0x2bf93c];return _0x11598d;};import{ContextPlugin as _0x2a1951,Context as _0x184cf1}from'ckeditor5/src/core';import _0x3c495a from'./annotationsuis';import _0x41979b from'./sidebar';import _0x492660 from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x445565,BodyCollection as _0x56ff43}from'ckeditor5/src/ui';import{CKEditorError as _0x598556,DomEmitterMixin as _0x23a6a6,keyCodes as _0x2ed5ce,Collection as _0x52d27c}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x474423}from'lodash-es';import _0x179a0f from'./editorannotations';export default class s extends _0x2a1951{static get[_0x1159('0x5b')](){return[_0x41979b,_0x3c495a];}static get[_0x1159('0x5a')](){return _0x1159('0x0');}constructor(_0x5d7c1d){super(_0x5d7c1d),this[_0x1159('0x53')]=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this[_0x1159('0x50')]=Object[_0x1159('0x2c')](_0x23a6a6),this[_0x1159('0x49')]=new Map(),this[_0x1159('0x51')](_0x1159('0x3e'),null),this[_0x1159('0x1d')]=null,this[_0x1159('0xa')]=[],this[_0x1159('0x21')]=new _0x52d27c(),this[_0x1159('0x4d')]=_0x474423(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}[_0x1159('0x36')](){this[_0x1159('0x2')]['plugins'][_0x1159('0x22')](_0x3c495a)[_0x1159('0x23')]('narrowSidebar',this),this[_0x1159('0x54')]=new _0x56ff43(this[_0x1159('0x2')][_0x1159('0x27')]),this[_0x1159('0x46')]=new _0x445565(this[_0x1159('0x2')][_0x1159('0x27')]),this[_0x1159('0x54')][_0x1159('0x39')](),this[_0x1159('0x54')][_0x1159('0x9')](this[_0x1159('0x46')]);}[_0x1159('0x41')](_0x34861a){this[_0x1159('0x1d')]=_0x34861a;const _0x2427cf=this[_0x1159('0x2')][_0x1159('0x45')]['get'](_0x41979b),_0x28c830=this['balloonPanelView'];if(_0x2427cf[_0x1159('0x29')]=_0x34861a,this[_0x1159('0x53')])throw new _0x598556(_0x1159('0x5d'),this);this[_0x1159('0x53')]=!0x0,this[_0x1159('0x2d')](_0x2427cf,_0x1159('0x1'),()=>{this[_0x1159('0x31')](),this[_0x1159('0x2d')](_0x2427cf,_0x1159('0x4f'),_0xb7bb78=>{_0xb7bb78['off'](),this[_0x1159('0x41')](_0x34861a);});}),_0x2427cf['_attachToContainer']({'viewClass':_0x1159('0x24'),'spaceBetweenItems':0x5});const _0x1db299=_0x1ee029=>{const _0x2191d6=new _0x492660(this[_0x1159('0x2')]['locale']);_0x2427cf[_0x1159('0x1c')](_0x1ee029,_0x2191d6),this[_0x1159('0x49')][_0x1159('0x51')](_0x1ee029,_0x2191d6),_0x2191d6['bind'](_0x1159('0x3b'),_0x1159('0x5f'),'number')['to'](_0x1ee029[_0x1159('0x16')],'isDirty',_0x1159('0x5c'),_0x1159('0x57')),_0x2191d6['on'](_0x1159('0x3f'),()=>{this[_0x1159('0x47')][_0x1159('0x10')](),_0x28c830[_0x1159('0x12')][_0x1159('0x3a')]!==_0x1ee029[_0x1159('0x16')]?(this[_0x1159('0x1b')](_0x1ee029),_0x1ee029[_0x1159('0x16')][_0x1159('0x38')][_0x1159('0x20')](),this[_0x1159('0x1e')](_0x1ee029)):this[_0x1159('0x1e')](null);});};for(const _0x2e6e7b of _0x34861a)_0x1db299(_0x2e6e7b);this[_0x1159('0x2d')](_0x34861a,_0x1159('0x9'),(_0xaa6ec5,_0x462ee5)=>{_0x1db299(_0x462ee5);}),this['listenTo'](_0x34861a,_0x1159('0xc'),(_0x36f45e,_0x408e83,_0x1d6181)=>{this['_annotationToNarrowView'][_0x1159('0x22')](_0x408e83)[_0x1159('0x42')](),this[_0x1159('0x49')][_0x1159('0x14')](_0x408e83),_0x2427cf[_0x1159('0xd')]({'removedAnnotation':_0x408e83,'previousAnnotation':_0x34861a[_0x1159('0x22')](_0x1d6181-0x1),'nextAnnotation':_0x34861a[_0x1159('0x22')](_0x1d6181+0x1)}),_0x408e83===this[_0x1159('0x3e')]&&this[_0x1159('0x1e')](null);},{'priority':_0x1159('0x3d')}),this['listenTo'](_0x34861a,_0x1159('0x20'),(_0x2bf11d,_0x42ca27)=>{this[_0x1159('0x1e')](_0x42ca27);}),this['listenTo'](_0x34861a,_0x1159('0x4'),()=>{this[_0x1159('0x1e')](null);}),this[_0x1159('0x50')]['listenTo'](document,_0x1159('0x17'),(_0x347e50,_0x3ca2e8)=>{_0x3ca2e8[_0x1159('0x8')]===_0x2ed5ce[_0x1159('0x59')]&&_0x28c830[_0x1159('0x7')]&&(this[_0x1159('0x47')][_0x1159('0x9')](_0x28c830['content'][_0x1159('0x3a')]),this['_hideBalloon'](),_0x3ca2e8['stopPropagation'](),_0x3ca2e8['preventDefault']());}),this['_domEmitter'][_0x1159('0x2d')](document,_0x1159('0x3c'),(_0x477cb5,_0x4142ed)=>{const _0x339c1c=_0x4142ed['target'];_0x28c830[_0x1159('0x7')]&&_0x28c830[_0x1159('0x38')][_0x1159('0x1a')](_0x339c1c)||_0x2427cf[_0x1159('0x16')][_0x1159('0x38')][_0x1159('0x1a')](_0x339c1c)||_0x477cb5[_0x1159('0x30')]||(this[_0x1159('0x47')]['clear'](),this['_hideBalloon'](),this[_0x1159('0x1e')](null));});const _0x407ab4=this[_0x1159('0x2')]instanceof _0x184cf1?this['context']['editors']:new _0x52d27c([this[_0x1159('0x2')]]);for(const _0x929a21 of _0x407ab4)this[_0x1159('0x55')](_0x929a21);this[_0x1159('0x2d')](_0x407ab4,_0x1159('0x9'),(_0x3341e9,_0x23a7a4)=>{this[_0x1159('0x2d')](_0x23a7a4,'ready',()=>{this[_0x1159('0x55')](_0x23a7a4);});}),this[_0x1159('0x2d')](_0x407ab4,'remove',(_0x113820,_0x4340cf)=>{_0x4340cf[_0x1159('0x45')][_0x1159('0x40')](_0x1159('0x2a'))&&this[_0x1159('0x2f')](_0x4340cf[_0x1159('0x45')][_0x1159('0x22')](_0x1159('0x2a')));}),window['addEventListener'](_0x1159('0x44'),this[_0x1159('0x4d')]),this[_0x1159('0x34')]();}[_0x1159('0x1e')](_0x1307f1){if(_0x1307f1===this['activeAnnotation'])return;const _0x482464=this[_0x1159('0x2')][_0x1159('0x45')][_0x1159('0x22')](_0x41979b);if(_0x482464['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x1307f1,'disableAnimationOnActivatedAnnotation':!0x0}),_0x1307f1)_0x482464[_0x1159('0x5')](_0x1307f1)?this['_showBalloon'](_0x1307f1):this['_hideBalloon']();else this[_0x1159('0x15')]();this[_0x1159('0x3e')]=_0x1307f1;}['detach'](){if(!this[_0x1159('0x53')])throw new _0x598556('narrowsidebar-detach-not-attached',this);this[_0x1159('0x1e')](null);const _0x448510=this[_0x1159('0x2')][_0x1159('0x45')][_0x1159('0x22')](_0x41979b);this[_0x1159('0x15')](),Array[_0x1159('0x5e')](this[_0x1159('0x49')]['values'](),_0x2afb92=>_0x2afb92['destroy']()),this[_0x1159('0x49')][_0x1159('0x10')](),_0x448510[_0x1159('0x1f')](this['annotations']),this[_0x1159('0x2b')](),this[_0x1159('0x50')][_0x1159('0x2b')](),this[_0x1159('0x2')]instanceof _0x184cf1&&this[_0x1159('0x2b')](this[_0x1159('0x2')][_0x1159('0x19')]);for(const _0x5c195d of Array['from'](this[_0x1159('0x21')]))this['_destroyEditorAnnotationsIntegration'](_0x5c195d);window[_0x1159('0x60')]('resize',this[_0x1159('0x4d')]),this[_0x1159('0x4d')][_0x1159('0x4e')](),this[_0x1159('0xa')]=[],this['isAttached']=!0x1,this[_0x1159('0x1d')]=null;}[_0x1159('0x42')](){this[_0x1159('0x53')]&&this[_0x1159('0x31')](),this[_0x1159('0x54')][_0x1159('0x4a')]();}[_0x1159('0x55')](_0x79f910){const _0x5c1d1f=_0x79f910[_0x1159('0x45')][_0x1159('0x22')](_0x179a0f),_0x86fa9d=this['context'][_0x1159('0x45')][_0x1159('0x22')](_0x41979b),_0x173f55=this[_0x1159('0x1d')],_0x5f1b33=this[_0x1159('0x46')],_0x1a6576=()=>{const _0x12d6fe=_0x5c1d1f[_0x1159('0xb')]({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this[_0x1159('0x25')](_0x12d6fe),this[_0x1159('0x1e')](_0x12d6fe[0x0]||null);};this['listenTo'](_0x5c1d1f,_0x1159('0x26'),_0x1a6576),this[_0x1159('0x2d')](_0x5c1d1f,_0x1159('0x4'),(_0x572c4c,{isAnnotationTracked:_0x44fde4})=>{this[_0x1159('0x3e')]&&_0x44fde4(this[_0x1159('0x3e')])&&(this[_0x1159('0x25')]([]),this[_0x1159('0x1e')](null));}),this[_0x1159('0x2d')](_0x5c1d1f,_0x1159('0x2e'),()=>{this[_0x1159('0x4d')]();}),this[_0x1159('0x2d')](_0x173f55,_0x1159('0x4'),_0x5b5a06=>{_0x5c1d1f[_0x1159('0x6')]()&&_0x5b5a06[_0x1159('0x18')]();},{'priority':_0x1159('0x4c')}),this[_0x1159('0x2d')](this[_0x1159('0x50')],_0x1159('0x3c'),(_0x477627,_0x5f3a33)=>{const _0x4eebda=_0x5f3a33[_0x1159('0x58')];_0x5f1b33['isVisible']&&_0x5f1b33['element'][_0x1159('0x1a')](_0x4eebda)||_0x86fa9d[_0x1159('0x16')][_0x1159('0x38')][_0x1159('0x1a')](_0x4eebda)||this[_0x1159('0x3e')]&&_0x5c1d1f['hasDomSelection']()&&(_0x1a6576(),_0x477627[_0x1159('0x30')]=!0x0);},{'priority':_0x1159('0x4c')}),this['_editorAnnotations']['add'](_0x5c1d1f);}[_0x1159('0x2f')](_0x73fc15){_0x73fc15&&(this[_0x1159('0x2b')](_0x73fc15),this[_0x1159('0x21')]['remove'](_0x73fc15));}[_0x1159('0x25')](_0x116806){for(const _0x588739 of this['_selectedAnnotations'])_0x116806[_0x1159('0x28')](_0x588739)||this[_0x1159('0x47')][_0x1159('0x14')](_0x588739[_0x1159('0x16')]);this['_selectedAnnotations']=_0x116806;}[_0x1159('0x34')](){const _0x294b6f=this[_0x1159('0x46')];this[_0x1159('0x1d')][_0x1159('0xe')](),_0x294b6f['isVisible']&&this[_0x1159('0x32')]();}[_0x1159('0x1b')](_0x354f04){if(this[_0x1159('0x47')]['has'](_0x354f04['view']))return;const _0x5e8753=this[_0x1159('0x46')][_0x1159('0x12')][_0x1159('0x3a')];_0x5e8753!==_0x354f04[_0x1159('0x16')]?(_0x5e8753&&this[_0x1159('0x35')](_0x5e8753),this[_0x1159('0x56')](_0x354f04[_0x1159('0x16')]),this['balloonPanelView'][_0x1159('0x12')][_0x1159('0x10')](),this['balloonPanelView'][_0x1159('0x12')][_0x1159('0x9')](_0x354f04[_0x1159('0x16')]),this[_0x1159('0x32')]()):this['_updateBalloonPosition']();}[_0x1159('0x32')](){const _0x55ceff=this[_0x1159('0x46')][_0x1159('0x12')]['first'],_0x233b86=_0x55ceff&&this['annotations'][_0x1159('0x13')](_0x55ceff);if(!_0x233b86||!this[_0x1159('0x49')][_0x1159('0x40')](_0x233b86))return;const _0x280740=this[_0x1159('0x49')][_0x1159('0x22')](_0x233b86)[_0x1159('0x38')],_0x1d9be=function(){const _0x1d7aa0=_0x445565[_0x1159('0x3')];return[_0x1d7aa0[_0x1159('0x11')],_0x1d7aa0[_0x1159('0x4b')],_0x1d7aa0[_0x1159('0x37')],_0x1d7aa0['northArrowSouth'],_0x1d7aa0[_0x1159('0x33')],_0x1d7aa0[_0x1159('0xf')]];}();this[_0x1159('0x46')][_0x1159('0x43')]({'target':_0x280740,'positions':_0x1d9be});}[_0x1159('0x15')](){const _0x375987=this[_0x1159('0x46')],_0x59c1f1=_0x375987[_0x1159('0x12')]['first'];_0x59c1f1&&(this['_detachListeners'](_0x59c1f1),_0x375987[_0x1159('0x52')](),_0x375987[_0x1159('0x12')][_0x1159('0x10')]());}[_0x1159('0x56')](_0x1aa958){this['listenTo'](_0x1aa958,'change:height',()=>this[_0x1159('0x32')]()),this[_0x1159('0x2d')](_0x1aa958,_0x1159('0x48'),(_0x32fc38,_0x5b3825)=>{this['_manuallyClosedAnnotationViews'][_0x1159('0x9')](_0x1aa958),this[_0x1159('0x15')](),_0x5b3825();});}[_0x1159('0x35')](_0x2b7547){this[_0x1159('0x2b')](_0x2b7547);}}
|
|
@@ -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 _0x23f9=['_getTargetTop','delete','_alignForTopChange','_alignAfterItem','_attachToContainer','appendChild','_targetTop','max','top','get','refresh','change:bottom','_getItemAfter','init','sidebar-setcontainer-invalid-element','_alignBeforeItem','content','destroy','getSidebarItemView','rearrange','unbind','_alignToTargetRect','minHeight','_lastItem','define','length','element','sidebar-attachtocontainer-missing-container','setContainer','bind','nodeType','isActive','view','listenTo','_activeAnnotation','_recalculate','sidebar.preventScrollOutOfView','_getMaxAvailableTop','remove','_updateLastItem','object','_destroySidebarItemView','change:targetRect','_spaceBetweenItems','_alignForBottomChange','Sidebar','_setItemTop','add','getIndex','context','set','container','change:_lastItem','addAnnotation','last','change:top','render','_detachFromContainer','updateHeight','_createSidebarView','_getItemBefore','stopListening','_sidebarItemViewToAnnotation','list','targetRect','_annotations','_annotationToSidebarItemView','target','_recalculateBuffer','bottom','locale','clear','isAnimationDisabled','config'];(function(_0x35e5b6,_0x23f9f7){const _0x102d30=function(_0x5cac3f){while(--_0x5cac3f){_0x35e5b6['push'](_0x35e5b6['shift']());}};_0x102d30(++_0x23f9f7);}(_0x23f9,0x146));const _0x102d=function(_0x35e5b6,_0x23f9f7){_0x35e5b6=_0x35e5b6-0x0;let _0x102d30=_0x23f9[_0x35e5b6];return _0x102d30;};import{ContextPlugin as _0x14445a}from'ckeditor5/src/core';import{Rect as _0x1b1f6f,CKEditorError as _0x5cf2db}from'ckeditor5/src/utils';import _0x240aa0 from'./view/sidebarview';import _0x5d4168 from'./view/sidebaritemview';export default class z extends _0x14445a{static get['pluginName'](){return _0x102d('0xf');}constructor(_0x5e0158){super(_0x5e0158),this[_0x102d('0x14')]('_lastItem',void 0x0),this[_0x102d('0x2')]=this[_0x102d('0x1d')](),this[_0x102d('0x14')]('container',null),this[_0x102d('0xd')]=0x19,this[_0x102d('0x20')]=new Map(),this[_0x102d('0x24')]=new Map(),this[_0x102d('0x13')][_0x102d('0x2b')][_0x102d('0x44')](_0x102d('0x6'),!0x1),this[_0x102d('0x23')]=null,this['_activeAnnotation']=null,this[_0x102d('0x26')]=[];}[_0x102d('0x39')](){const _0x139444=this[_0x102d('0x13')]['config']['get']('sidebar.container');_0x139444&&this[_0x102d('0x48')](_0x139444);}[_0x102d('0x48')](_0x34d6f4){if(!y(_0x34d6f4))throw new _0x5cf2db(_0x102d('0x3a'));this[_0x102d('0x15')]=_0x34d6f4;}[_0x102d('0x30')]({viewClass:_0x3dac17='',spaceBetweenItems:_0x26ccfc=0x19}={}){if(!y(this['container']))throw new _0x5cf2db(_0x102d('0x47'),this);this[_0x102d('0x15')][_0x102d('0x31')](this['view'][_0x102d('0x46')]),this[_0x102d('0x2')]['class']=_0x3dac17,this[_0x102d('0xd')]=_0x26ccfc;}[_0x102d('0x3f')]({removedAnnotation:_0x5e847d,previousAnnotation:_0x5e02b4,nextAnnotation:_0x55c417}){const _0xc117f=this['getSidebarItemView'](_0x5e847d);this['view'][_0x102d('0x21')][_0x102d('0x8')](_0xc117f),this[_0x102d('0xb')](_0x5e847d),_0x5e02b4&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x5e02b4)),_0x55c417&&this[_0x102d('0x41')](this['getSidebarItemView'](_0x55c417)),this['_updateLastItem']();}[_0x102d('0x36')]({blurredAnnotation:_0x41397e,activatedAnnotation:_0x56386a,disableAnimationOnActivatedAnnotation:_0x2d1666}){if(this[_0x102d('0x4')]=_0x56386a,_0x41397e){_0x41397e['isActive']=!0x1;const _0x5d0fe5=this[_0x102d('0x3e')](_0x41397e);_0x5d0fe5&&_0x2d1666&&(_0x5d0fe5[_0x102d('0x2a')]=!0x1);}if(_0x56386a){const _0x9b5666=this[_0x102d('0x3e')](_0x56386a);_0x9b5666&&(_0x56386a[_0x102d('0x1')]=!0x0,_0x2d1666&&(_0x9b5666['isAnimationDisabled']=!0x0,_0x9b5666[_0x102d('0x34')]+=0x1),this[_0x102d('0x41')](_0x9b5666));}}[_0x102d('0x1b')](_0x2b41e5){if(this['stopListening'](),this[_0x102d('0x2')][_0x102d('0x46')][_0x102d('0x8')](),_0x2b41e5)for(const _0x428825 of _0x2b41e5)this[_0x102d('0xb')](_0x428825);this[_0x102d('0x2')][_0x102d('0x21')][_0x102d('0x29')](),this[_0x102d('0x2')]['class']='',this['_lastItem']=null;}[_0x102d('0x17')](_0xb4d019,_0x4d73e2){_0x4d73e2||(_0x4d73e2=_0xb4d019[_0x102d('0x2')]);const _0x34f1c3=new _0x5d4168(this[_0x102d('0x13')][_0x102d('0x28')]);this[_0x102d('0x20')]['set'](_0x34f1c3,_0xb4d019),this[_0x102d('0x24')]['set'](_0xb4d019,_0x34f1c3),_0x34f1c3[_0x102d('0x3c')][_0x102d('0x11')](_0x4d73e2),this[_0x102d('0x3')](_0xb4d019[_0x102d('0x2')],_0x102d('0xc'),(_0xf01d3c,_0x17667e,_0x25b043)=>{const _0x3b8e9a=this[_0x102d('0x2c')](_0xb4d019,_0x25b043);_0x34f1c3[_0x102d('0x32')]!=_0x3b8e9a&&(_0x34f1c3[_0x102d('0x32')]=_0x3b8e9a,this[_0x102d('0x10')](_0x34f1c3,_0x3b8e9a));}),this[_0x102d('0x3')](_0x34f1c3,_0x102d('0x19'),()=>{this[_0x102d('0x5')](_0x34f1c3,_0x102d('0x34'));}),this[_0x102d('0x3')](_0x34f1c3,_0x102d('0x37'),()=>{this['_recalculate'](_0x34f1c3,'bottom');}),this['_alignToTargetRect'](_0x34f1c3);const _0x346eb5=this[_0x102d('0x1e')](_0x34f1c3);if(_0x346eb5)this[_0x102d('0x2f')](_0x346eb5,_0x34f1c3)||this[_0x102d('0x41')](_0x34f1c3);else this[_0x102d('0x41')](_0x34f1c3);return this[_0x102d('0x9')](),this[_0x102d('0x2')][_0x102d('0x21')][_0x102d('0x11')](_0x34f1c3),_0x34f1c3;}['_alignForTopChange'](_0x432592){if(!_0x432592[_0x102d('0x3c')][_0x102d('0x45')])return;const _0x33e410=this[_0x102d('0x1e')](_0x432592);if(!_0x33e410)return;const _0x304884=this[_0x102d('0x20')]['get'](_0x33e410),_0x275f7f=this[_0x102d('0x4')];_0x275f7f&&_0x275f7f===_0x304884?this['_alignAfterItem'](_0x33e410,_0x432592):this[_0x102d('0x3b')](_0x432592,_0x33e410);}[_0x102d('0xe')](_0x18c74a){if(!_0x18c74a[_0x102d('0x3c')][_0x102d('0x45')])return;const _0x2b1384=this[_0x102d('0x38')](_0x18c74a);if(!_0x2b1384)return;const _0x7f0c03=this[_0x102d('0x20')][_0x102d('0x35')](_0x2b1384),_0x1812ea=this[_0x102d('0x13')][_0x102d('0x2b')]['get'](_0x102d('0x6')),_0x534886=this[_0x102d('0x4')];_0x534886&&_0x534886===_0x7f0c03&&_0x1812ea?(this[_0x102d('0x3b')](_0x2b1384,_0x18c74a),this[_0x102d('0x2f')](_0x18c74a,_0x2b1384)):_0x534886&&_0x534886===_0x7f0c03?this['_alignBeforeItem'](_0x2b1384,_0x18c74a):this[_0x102d('0x2f')](_0x18c74a,_0x2b1384);}[_0x102d('0x5')](_0x3b6a7a,_0x3f34de){0x0===this[_0x102d('0x26')]['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x5660aa,changedProp:_0x35b2d5}of this[_0x102d('0x26')])_0x102d('0x34')===_0x35b2d5?this[_0x102d('0x2e')](_0x5660aa):this[_0x102d('0xe')](_0x5660aa);this['_recalculateBuffer']=[];},0xa),this[_0x102d('0x26')]['push']({'sidebarItemView':_0x3b6a7a,'changedProp':_0x3f34de});}[_0x102d('0x3e')](_0x5446f4){return this['_annotationToSidebarItemView']['get'](_0x5446f4);}[_0x102d('0x3d')](){this[_0x102d('0x2')][_0x102d('0x3d')]();}[_0x102d('0xb')](_0x47b04b){const _0x5c33df=this[_0x102d('0x3e')](_0x47b04b);this[_0x102d('0x1f')](_0x5c33df),this[_0x102d('0x1f')](_0x47b04b[_0x102d('0x2')]),_0x5c33df[_0x102d('0x3d')](),this['_annotationToSidebarItemView']['delete'](_0x47b04b),this[_0x102d('0x20')][_0x102d('0x2d')](_0x5c33df);}['_createSidebarView'](){const _0x5be744=new _0x240aa0(this[_0x102d('0x13')][_0x102d('0x28')]);return _0x5be744[_0x102d('0x1a')](),this['on'](_0x102d('0x16'),(_0x12c3bf,_0x3aaaf0,_0x5d00bb,_0x458b45)=>{_0x458b45&&_0x5be744[_0x102d('0x40')]('minHeight'),_0x5d00bb?_0x5be744[_0x102d('0x49')]('minHeight')['to'](_0x5d00bb,'bottom'):_0x5be744[_0x102d('0x42')]=null;}),_0x5be744;}[_0x102d('0x9')](){var _0x229810;this[_0x102d('0x43')]=(null===(_0x229810=this[_0x102d('0x23')])||void 0x0===_0x229810?void 0x0:_0x229810[_0x102d('0x18')])?this['getSidebarItemView'](this['_annotations'][_0x102d('0x18')]):null;}[_0x102d('0x1e')](_0x2454e3){var _0x2407d2;const _0xb6aa0=this[_0x102d('0x20')]['get'](_0x2454e3),_0x221f50=_0xb6aa0&&(null===(_0x2407d2=this[_0x102d('0x23')])||void 0x0===_0x2407d2?void 0x0:_0x2407d2['get'](this[_0x102d('0x23')][_0x102d('0x12')](_0xb6aa0)-0x1));return _0x221f50&&this[_0x102d('0x3e')](_0x221f50)||null;}['_getItemAfter'](_0xd939e5){var _0x221341;const _0x305337=this[_0x102d('0x20')]['get'](_0xd939e5),_0x1c55d3=_0x305337&&(null===(_0x221341=this[_0x102d('0x23')])||void 0x0===_0x221341?void 0x0:_0x221341['get'](this[_0x102d('0x23')]['getIndex'](_0x305337)+0x1));return _0x1c55d3&&this[_0x102d('0x3e')](_0x1c55d3)||null;}['_alignBeforeItem'](_0x4be619,_0x2b89c2){_0x4be619['updateHeight']();const _0x314b75=H(_0x2b89c2[_0x102d('0x27')]+this[_0x102d('0xd')],_0x4be619[_0x102d('0x34')]);return!!_0x314b75&&(this[_0x102d('0x10')](_0x2b89c2,_0x2b89c2[_0x102d('0x34')]-_0x314b75),!0x0);}['_alignAfterItem'](_0x3f9fb9,_0x3de95e){_0x3f9fb9['updateHeight']();const _0x5438d0=H(_0x3f9fb9[_0x102d('0x27')]+this['_spaceBetweenItems'],_0x3de95e['top']);return!!_0x5438d0&&(this['_setItemTop'](_0x3de95e,_0x3de95e[_0x102d('0x34')]+_0x5438d0,!0x1),!0x0);}[_0x102d('0x41')](_0x567ca0){const _0x4346a6=this[_0x102d('0x20')][_0x102d('0x35')](_0x567ca0);if(!_0x4346a6||!_0x4346a6['target']||!_0x4346a6[_0x102d('0x22')])return;const _0x469431=this[_0x102d('0x2c')](_0x4346a6,_0x4346a6[_0x102d('0x22')]);this['_setItemTop'](_0x567ca0,_0x469431);}[_0x102d('0x2c')](_0x1416a8,_0xccdf3a){if(null===_0xccdf3a)return 0x0;if(_0x1416a8[_0x102d('0x25')]instanceof _0x1b1f6f)return _0xccdf3a[_0x102d('0x34')];{const _0x344bc1=new _0x1b1f6f(this[_0x102d('0x2')]['element'])[_0x102d('0x34')];return _0xccdf3a[_0x102d('0x34')]-_0x344bc1;}}[_0x102d('0x10')](_0xc5c6fb,_0xd3c72b,_0x4f0fbb=this[_0x102d('0x13')][_0x102d('0x2b')][_0x102d('0x35')]('sidebar.preventScrollOutOfView')){_0x4f0fbb&&(_0xd3c72b=Math[_0x102d('0x33')](_0xd3c72b,this[_0x102d('0x7')](_0xc5c6fb))),_0xc5c6fb['top']=_0xd3c72b;}[_0x102d('0x7')](_0x48fa40){let _0x109045=this[_0x102d('0x1e')](_0x48fa40),_0x2e3ece=0x0;for(;_0x109045;)_0x109045[_0x102d('0x1c')](),_0x2e3ece+=this[_0x102d('0xd')]+_0x109045['height'],_0x109045=this[_0x102d('0x1e')](_0x109045);return _0x2e3ece;}}function H(_0x3a08cf,_0x30f202){return Math[_0x102d('0x33')](_0x3a08cf-_0x30f202,0x0);}function y(_0x5e126d){return null!==_0x5e126d&&_0x102d('0xa')==typeof _0x5e126d&&0x1===_0x5e126d[_0x102d('0x0')];}
|
|
@@ -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 _0x2df1=['counterView','bind','span','set','add','ck-annotation-counter__badge--edit-mode','_badge','setTemplate','...','number','toString','isDirty','ck-annotation-counter__badge','annotationType','children'];(function(_0x4a37ae,_0x2df1bf){const _0x460c37=function(_0x56cf1f){while(--_0x56cf1f){_0x4a37ae['push'](_0x4a37ae['shift']());}};_0x460c37(++_0x2df1bf);}(_0x2df1,0x19c));const _0x460c=function(_0x4a37ae,_0x2df1bf){_0x4a37ae=_0x4a37ae-0x0;let _0x460c37=_0x2df1[_0x4a37ae];return _0x460c37;};import{ButtonView as _0x244a67,View as _0x3f56f5}from'ckeditor5/src/ui';import _0x1307b2 from'../../../theme/icons/add-comment.svg';export default class D extends _0x244a67{constructor(_0x24ea56){super(_0x24ea56);const _0x4a7e63=this['bindTemplate'];this[_0x460c('0xb')](_0x460c('0x4'),!0x1),this['set'](_0x460c('0x2'),0x0),this[_0x460c('0x9')](_0x460c('0xe'))['to'](this,_0x460c('0x4'),this,_0x460c('0x2'),(_0x1c72eb,_0x313e73)=>_0x1c72eb?_0x460c('0x1'):_0x313e73[_0x460c('0x3')]()),this['set'](_0x460c('0x6'),''),this['icon']=_0x1307b2,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this[_0x460c('0x8')]=new _0x3f56f5(),this['counterView'][_0x460c('0x0')]({'tag':_0x460c('0xa'),'attributes':{'class':[_0x460c('0x5'),_0x4a7e63['to']('annotationType',_0x2a95eb=>'ck-annotation-counter__badge--'+_0x2a95eb),_0x4a7e63['if'](_0x460c('0x4'),_0x460c('0xd'))]},'children':[{'text':_0x4a7e63['to'](_0x460c('0xe'))}]}),this[_0x460c('0x7')][_0x460c('0xc')](this['counterView']);}}
|