@ckeditor/ckeditor5-comments 38.0.1 → 38.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/comments.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sq.js +1 -0
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sq.po +111 -0
- package/package.json +10 -8
- package/src/annotations/annotation.d.ts +86 -86
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.d.ts +94 -94
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.d.ts +150 -150
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.d.ts +228 -227
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +63 -62
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +86 -84
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +81 -80
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.d.ts +96 -96
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -25
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.d.ts +86 -86
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.d.ts +51 -51
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.d.ts +28 -28
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.d.ts +73 -72
- package/src/annotations/widesidebar.js +1 -1
- package/src/augmentation.d.ts +48 -48
- package/src/comments/addcommentthreadcommand.d.ts +31 -31
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.d.ts +27 -25
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.d.ts +34 -32
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.d.ts +75 -71
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1088 -1084
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +29 -25
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -13
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.d.ts +17 -17
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -32
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -27
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -32
- package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
- package/src/comments/ui/commentthreadcontroller.d.ts +64 -64
- package/src/comments/ui/commentthreadcontroller.js +1 -1
- package/src/comments/ui/view/basecommentthreadview.d.ts +108 -108
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.d.ts +108 -108
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -9
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.d.ts +10 -10
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.d.ts +82 -82
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.d.ts +34 -34
- package/src/comments/ui/view/commentsarchiveview.js +1 -1
- package/src/comments/ui/view/commentslistview.d.ts +96 -96
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -46
- package/src/comments/ui/view/commentthreadheaderview.js +1 -1
- package/src/comments/ui/view/commentthreadinputview.d.ts +37 -37
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.d.ts +113 -113
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.d.ts +239 -239
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.d.ts +31 -22
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +29 -28
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +172 -172
- package/src/index.d.ts +21 -19
- package/src/index.js +1 -1
- package/src/utils/common-translations.d.ts +5 -5
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.d.ts +13 -13
- package/src/utils/createmutationobserver.js +1 -1
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/annotations/editorannotations
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { Plugin, type
|
|
6
|
-
import
|
|
7
|
-
import type
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @param options.
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/editorannotations
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
6
|
+
import Annotations from './annotations';
|
|
7
|
+
import type Annotation from './annotation';
|
|
8
|
+
import type AnnotationCollection from './annotationcollection';
|
|
9
|
+
/**
|
|
10
|
+
* Integrates {@link module:comments/annotations/annotations~Annotations annotations} with the editor to provide proper behavior
|
|
11
|
+
* for annotations created through the editor features.
|
|
12
|
+
*
|
|
13
|
+
* *Note: The API of this class might change in the near future.*
|
|
14
|
+
*
|
|
15
|
+
* Collects all types of the annotations created through the editor features and their markers and decides which annotation is currently
|
|
16
|
+
* selected by the selection.
|
|
17
|
+
*
|
|
18
|
+
* Every editor plugin that adds an annotation should also
|
|
19
|
+
* {@link module:comments/annotations/editorannotations~EditorAnnotations#addSourceCollector register a callback}
|
|
20
|
+
* in which it will check whether given annotation should be marked as selected.
|
|
21
|
+
*/
|
|
22
|
+
export default class EditorAnnotations extends Plugin {
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get requires(): readonly [typeof Annotations];
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get pluginName(): "EditorAnnotations";
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
constructor(editor: Editor);
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
init(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Registers given annotation as an editor annotation, that is an annotation that is linked with a target inside the editor content.
|
|
41
|
+
*/
|
|
42
|
+
registerAnnotation(annotation: Annotation): void;
|
|
43
|
+
hasDomSelection(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Registers a callback that collects annotations and their markers.
|
|
46
|
+
*/
|
|
47
|
+
addSourceCollector(callback: Function): void;
|
|
48
|
+
/**
|
|
49
|
+
* Finds all annotations selected by the editor selection and marks the most inner one as the active annotation.
|
|
50
|
+
*/
|
|
51
|
+
refreshSelectedViews(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Finds all annotations for selected markers in order from the most inner marker to the most outer marker.
|
|
54
|
+
*
|
|
55
|
+
* @param options.annotations The collection of annotations for given UI.
|
|
56
|
+
* @param options.activeAnnotation The given UI active annotation.
|
|
57
|
+
* It is used to determine the order if the selection contains the active annotation's marker.
|
|
58
|
+
*/
|
|
59
|
+
getOrderedSelectedAnnotations({ activeAnnotation, annotations }: {
|
|
60
|
+
activeAnnotation: Annotation | null;
|
|
61
|
+
annotations: AnnotationCollection;
|
|
62
|
+
}): Array<Annotation>;
|
|
63
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x32b7=['element','refresh','isCollapsed','hasDomSelection','set','pluginName','selection','getOrderedSelectedAnnotations','blur','focusTracker','refreshSelectedViews','collection','directChange','map','getRanges','annotation','innerView','_editorAnnotationsData','remove','listenTo','push','getByInnerView','cancel','has','document','add','change:range','isEqual','from','isReadOnly','_editorAnnotations','plugins','editor','function','editorannotations-invalid-source-callback','_dataCollectors','uiUpdate','fire','view','model','editing','range','get','init','update','addSourceCollector','change:isFocused','containsRange'];(function(_0x5d7009,_0x32b7b1){const _0x14d6cd=function(_0x10d720){while(--_0x10d720){_0x5d7009['push'](_0x5d7009['shift']());}};_0x14d6cd(++_0x32b7b1);}(_0x32b7,0x1ec));const _0x14d6=function(_0x5d7009,_0x32b7b1){_0x5d7009=_0x5d7009-0x0;let _0x14d6cd=_0x32b7[_0x5d7009];return _0x14d6cd;};import{Plugin as _0x2c1bd5}from'ckeditor5/src/core';import{CKEditorError as _0x26e1ba}from'ckeditor5/src/utils';import{debounce as _0x2dc048}from'lodash-es';import _0x54e1fb from'./annotations';export default class k extends _0x2c1bd5{static get['requires'](){return[_0x54e1fb];}static get[_0x14d6('0x29')](){return'EditorAnnotations';}constructor(_0x1538fe){super(_0x1538fe),this[_0x14d6('0x17')]=new Set(),this['_editorAnnotations']=new Set();}[_0x14d6('0x1f')](){const _0x153aca=this['editor'],_0x5c0b7e=_0x153aca['model'][_0x14d6('0xc')][_0x14d6('0x2a')],_0x544140=_0x2dc048(()=>this[_0x14d6('0x2e')](),0xa);_0x5c0b7e['on'](_0x14d6('0xe'),(_0x12bce5,_0x5e7778)=>{_0x5e7778[_0x14d6('0x0')]&&(_0x544140[_0x14d6('0xa')](),this['refreshSelectedViews']());}),this[_0x14d6('0x7')](_0x153aca[_0x14d6('0x1c')][_0x14d6('0x1a')][_0x14d6('0xc')],_0x14d6('0x22'),(_0x26913c,_0x2443f4,_0x1ebcf8)=>{_0x1ebcf8&&_0x544140();}),this[_0x14d6('0x7')](_0x153aca['ui']['focusTracker'],_0x14d6('0x22'),(_0x27e60b,_0x164451,_0x51b5aa)=>{_0x51b5aa||_0x153aca[_0x14d6('0x11')]||this[_0x14d6('0x19')](_0x14d6('0x2c'),{'isAnnotationTracked':_0x3b3cc8=>this['_editorAnnotationsData']['has'](_0x3b3cc8[_0x14d6('0x4')])});}),this[_0x14d6('0x7')](this['editor']['ui'],_0x14d6('0x20'),()=>this['fire'](_0x14d6('0x18')));}['registerAnnotation'](_0xd6f92d){if(this[_0x14d6('0x12')][_0x14d6('0xb')](_0xd6f92d[_0x14d6('0x1a')]))return;this[_0x14d6('0x12')][_0x14d6('0xd')](_0xd6f92d[_0x14d6('0x1a')]),this[_0x14d6('0x14')]['ui'][_0x14d6('0x2d')][_0x14d6('0xd')](_0xd6f92d[_0x14d6('0x1a')][_0x14d6('0x24')]);const _0x37379c=this[_0x14d6('0x14')][_0x14d6('0x13')][_0x14d6('0x1e')](_0x54e1fb);this[_0x14d6('0x7')](_0x37379c[_0x14d6('0x2f')],_0x14d6('0x6'),(_0x123158,_0x1371f9)=>{this[_0x14d6('0x14')]['ui'][_0x14d6('0x2d')][_0x14d6('0x6')](_0x1371f9[_0x14d6('0x1a')][_0x14d6('0x24')]),this[_0x14d6('0x12')]['delete'](_0x1371f9[_0x14d6('0x1a')]);});}[_0x14d6('0x27')](){return this[_0x14d6('0x14')][_0x14d6('0x1c')][_0x14d6('0x1a')][_0x14d6('0x27')];}[_0x14d6('0x21')](_0x385686){if(_0x14d6('0x15')!=typeof _0x385686)throw new _0x26e1ba(_0x14d6('0x16'));this['_dataCollectors'][_0x14d6('0xd')](_0x385686);}[_0x14d6('0x2e')](){this[_0x14d6('0x19')](_0x14d6('0x25'));}[_0x14d6('0x2b')]({activeAnnotation:_0x4115d3,annotations:_0x2adb37}){const _0x58cdf4=[],_0x4270dc=this[_0x14d6('0x14')][_0x14d6('0x1b')]['document'][_0x14d6('0x2a')],_0x5a3561=Array[_0x14d6('0x10')](_0x4270dc[_0x14d6('0x2')]());for(const [_0x1dc852,_0x1ca95d]of this['_editorAnnotationsData']){const _0x5693dd=_0x369163(_0x1ca95d),_0x584437=_0x2adb37[_0x14d6('0x9')](_0x1dc852);_0x5693dd&&_0x584437&&_0x58cdf4[_0x14d6('0x8')]({'annotation':_0x584437,'range':_0x5693dd});}function _0x369163(_0x149bd7){for(const _0x1876aa of _0x149bd7)for(const _0x22c1a7 of _0x5a3561)if(_0x1876aa[_0x14d6('0x23')](_0x22c1a7,!_0x4270dc[_0x14d6('0x26')]))return _0x1876aa;return null;}return _0x58cdf4['sort']((_0x391634,_0x3b1de9)=>{const _0x5405c9=_0x391634[_0x14d6('0x1d')],_0x590765=_0x3b1de9[_0x14d6('0x1d')];if(!_0x5405c9[_0x14d6('0xf')](_0x590765)){if(_0x5405c9[_0x14d6('0x23')](_0x590765,!0x0))return 0x1;if(_0x590765['containsRange'](_0x5405c9,!0x0))return-0x1;}return _0x391634[_0x14d6('0x3')]==_0x4115d3?-0x1:_0x3b1de9[_0x14d6('0x3')]==_0x4115d3?0x1:0x0;})[_0x14d6('0x1')](_0x31f601=>_0x31f601[_0x14d6('0x3')]);}get[_0x14d6('0x5')](){const _0x2ac5d4=new Map();for(const _0x129bee of Array[_0x14d6('0x10')](this[_0x14d6('0x17')]))for(const [_0xb5af54,_0x5e5885]of _0x129bee())_0x2ac5d4[_0x14d6('0x28')](_0xb5af54,_0x5e5885);return _0x2ac5d4;}}
|
|
@@ -1,84 +1,86 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/annotations/inlineannotations
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { Plugin, type
|
|
6
|
-
import { type AnnotationsUI } from './annotationsuis';
|
|
7
|
-
import '
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* {@link module:comments/annotations/
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/inlineannotations
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
6
|
+
import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
|
|
7
|
+
import EditorAnnotations from './editorannotations';
|
|
8
|
+
import { ContextualBalloon } from 'ckeditor5/src/ui';
|
|
9
|
+
import './../../theme/annotation-inline.css';
|
|
10
|
+
import type Annotation from './annotation';
|
|
11
|
+
import type AnnotationCollection from './annotationcollection';
|
|
12
|
+
/**
|
|
13
|
+
* The popup-style UI for displaying annotations next to editor target elements.
|
|
14
|
+
*
|
|
15
|
+
* It displays {@link module:comments/annotations/annotation~Annotation annotations} in the
|
|
16
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon balloon} where the current
|
|
17
|
+
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#activeAnnotation} is the displayed one.
|
|
18
|
+
*
|
|
19
|
+
* Note: this UI type works only with {@link module:core/editor/editor~Editor the Editor} and cannot be used in integrations where
|
|
20
|
+
* there is only {@link module:core/context~Context context} without any editor.
|
|
21
|
+
*
|
|
22
|
+
* This UI is intended for narrow screens.
|
|
23
|
+
*
|
|
24
|
+
* To activate this UI use one of the following:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'inline' );
|
|
28
|
+
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'inline', filter );
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
32
|
+
*/
|
|
33
|
+
export default class InlineAnnotations extends Plugin implements AnnotationsUI<Plugin> {
|
|
34
|
+
/**
|
|
35
|
+
* An active annotation tracked by this UI.
|
|
36
|
+
*
|
|
37
|
+
* @observable
|
|
38
|
+
*/
|
|
39
|
+
activeAnnotation: Annotation | null;
|
|
40
|
+
isAttached: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* A collection of annotations controlled by this UI.
|
|
43
|
+
*
|
|
44
|
+
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
45
|
+
*
|
|
46
|
+
* It is set to `null` if `InlineAnnotations` is not
|
|
47
|
+
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#attach attached}.
|
|
48
|
+
*/
|
|
49
|
+
annotations: AnnotationCollection | null;
|
|
50
|
+
/**
|
|
51
|
+
* @inheritDoc
|
|
52
|
+
*/
|
|
53
|
+
static get requires(): readonly [typeof EditorAnnotations, typeof ContextualBalloon, typeof AnnotationsUIs];
|
|
54
|
+
/**
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
*/
|
|
57
|
+
static get pluginName(): "InlineAnnotations";
|
|
58
|
+
/**
|
|
59
|
+
* @inheritDoc
|
|
60
|
+
*/
|
|
61
|
+
constructor(editor: Editor);
|
|
62
|
+
/**
|
|
63
|
+
* @inheritDoc
|
|
64
|
+
*/
|
|
65
|
+
init(): void;
|
|
66
|
+
/**
|
|
67
|
+
* @inheritDoc
|
|
68
|
+
*/
|
|
69
|
+
afterInit(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Sets the active annotation for this UI.
|
|
72
|
+
*/
|
|
73
|
+
setActiveAnnotation(annotation: Annotation | null): void;
|
|
74
|
+
/**
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
attach(annotations: AnnotationCollection): void;
|
|
78
|
+
/**
|
|
79
|
+
* @inheritDoc
|
|
80
|
+
*/
|
|
81
|
+
detach(): void;
|
|
82
|
+
/**
|
|
83
|
+
* @inheritDoc
|
|
84
|
+
*/
|
|
85
|
+
destroy(): void;
|
|
86
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x68ec=['targetRect','_addAnnotationToBalloon','Esc','viewRangeToDom','hasView','isAttached','editableElement','getClientRects','view','hasActive','switchTo','updatePosition','activeAnnotation','detach','change:height','delete','map','getOrderedSelectedAnnotations','selection','update','stopListening','get','has','annotations','remove','target','listenTo','setActiveAnnotation','pluginName','destroy','_getBalloonTargetForAnnotation','getFirstRange','width','every','_addedAnnotations','attach','fromRect','left','afterInit','push','_closeAnnotation','mousedown','getBoundingClientRect','_setSelectedAnnotations','includes','isFocused','keystrokes','inlineannotations-detach-not-attached','focus','inline','domConverter','document','find','_forceRefresh','from','getByView','_selectedAnnotations','length','plugins','_manuallyClosed','editor','isActive','right','showStack','top','editing','change:visibleView','requires','clear','refresh','register','inlineannotations-not-allowed-with-context','InlineAnnotations','add','addObserver','visibleView','set','_balloon','_removeAnnotationFromBalloon','bottom','focusTracker','context'];(function(_0x35f67e,_0x68ecb3){const _0x11dcd7=function(_0x4aa1b6){while(--_0x4aa1b6){_0x35f67e['push'](_0x35f67e['shift']());}};_0x11dcd7(++_0x68ecb3);}(_0x68ec,0x146));const _0x11dc=function(_0x35f67e,_0x68ecb3){_0x35f67e=_0x35f67e-0x0;let _0x11dcd7=_0x68ec[_0x35f67e];return _0x11dcd7;};import{Plugin as _0x5665cc}from'ckeditor5/src/core';import _0x2d0665 from'./annotationsuis';import _0x10931f from'./editorannotations';import{ContextualBalloon as _0x22bb93}from'ckeditor5/src/ui';import{MouseObserver as _0x4a0163}from'ckeditor5/src/engine';import{CKEditorError as _0x2606df,Rect as _0x559d6e}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x5665cc{static get[_0x11dc('0x45')](){return[_0x10931f,_0x22bb93,_0x2d0665];}static get[_0x11dc('0x1e')](){return _0x11dc('0x4a');}constructor(_0x3853b9){super(_0x3853b9),_0x3853b9[_0x11dc('0x43')][_0x11dc('0xa')][_0x11dc('0x4c')](_0x4a0163),this['isAttached']=!0x1,this[_0x11dc('0x4e')]('activeAnnotation',null),this[_0x11dc('0x19')]=null,this[_0x11dc('0x3d')]=new Set(),this[_0x11dc('0x4f')]=_0x3853b9[_0x11dc('0x3c')][_0x11dc('0x17')](_0x22bb93),this[_0x11dc('0x24')]=new Set(),this['_selectedAnnotations']=[],this[_0x11dc('0x37')]=!0x1;}['init'](){const _0x1030e4=this[_0x11dc('0x3e')][_0x11dc('0x3c')][_0x11dc('0x17')](_0x2d0665);_0x1030e4[_0x11dc('0x1')]===this[_0x11dc('0x3e')]&&(_0x1030e4[_0x11dc('0x48')](_0x11dc('0x33'),this),this['editor'][_0x11dc('0x30')][_0x11dc('0x4e')]('Esc',(_0x53a118,_0x5a3a8a)=>{const _0x511be4=this[_0x11dc('0x4f')];if(this[_0x11dc('0x7')]&&_0x511be4[_0x11dc('0x4d')]){const _0x2beca9=this[_0x11dc('0x19')][_0x11dc('0x39')](_0x511be4['visibleView']);_0x2beca9&&this[_0x11dc('0x2a')](_0x2beca9),_0x5a3a8a();}}));}[_0x11dc('0x28')](){const _0x1aa42d=this[_0x11dc('0x3e')][_0x11dc('0x3c')][_0x11dc('0x17')](_0x2d0665);_0x1aa42d[_0x11dc('0x1')]===this[_0x11dc('0x3e')]&&(_0x1aa42d[_0x11dc('0xb')]()||_0x1aa42d[_0x11dc('0xc')](_0x11dc('0x33')));}[_0x11dc('0x1d')](_0x569be5){_0x569be5!==this[_0x11dc('0xe')]&&(this[_0x11dc('0xe')]&&(this['activeAnnotation'][_0x11dc('0x3f')]=!0x1),_0x569be5&&this[_0x11dc('0x3e')]['ui'][_0x11dc('0x0')][_0x11dc('0x2f')]&&(this[_0x11dc('0x19')][_0x11dc('0x18')](_0x569be5)&&this[_0x11dc('0x3')](_0x569be5,!0x0),_0x569be5[_0x11dc('0x3f')]=!0x0),_0x569be5||this[_0x11dc('0x2d')]([]),this[_0x11dc('0xe')]=_0x569be5);}[_0x11dc('0x25')](_0x19146c){this[_0x11dc('0x19')]=_0x19146c;const _0x5e7ad6=this[_0x11dc('0x3e')][_0x11dc('0x3c')][_0x11dc('0x17')](_0x2d0665),_0x107406=this[_0x11dc('0x4f')];if(this['isAttached'])throw new _0x2606df('inlineannotations-attach-already-attached',this);if(_0x5e7ad6[_0x11dc('0x1')]!==this[_0x11dc('0x3e')])throw new _0x2606df(_0x11dc('0x49'),this);const _0x18cc90=this[_0x11dc('0x3e')][_0x11dc('0x3c')][_0x11dc('0x17')](_0x10931f);this[_0x11dc('0x1c')](_0x18cc90,_0x11dc('0x47'),()=>{const _0x758bc4=_0x18cc90[_0x11dc('0x13')]({'annotations':this[_0x11dc('0x19')],'activeAnnotation':this['activeAnnotation']});var _0x3e5322,_0x20dc6c;!this[_0x11dc('0x37')]&&(_0x3e5322=_0x758bc4,_0x20dc6c=this[_0x11dc('0x3a')],_0x3e5322['length']===_0x20dc6c[_0x11dc('0x3b')]&&_0x3e5322[_0x11dc('0x23')](_0x34ab17=>_0x20dc6c[_0x11dc('0x2e')](_0x34ab17)))||(this[_0x11dc('0x37')]=!0x1,this[_0x11dc('0x2d')](_0x758bc4),this['setActiveAnnotation'](_0x758bc4[0x0]||null));}),this[_0x11dc('0x1c')](_0x18cc90,'blur',(_0x4d9956,{isAnnotationTracked:_0x4aa1b8})=>{this[_0x11dc('0xe')]&&_0x4aa1b8(this[_0x11dc('0xe')])&&(this[_0x11dc('0x2d')]([]),this[_0x11dc('0x1d')](null));}),this['listenTo'](this[_0x11dc('0x3e')]['ui'][_0x11dc('0x0')],'change:isFocused',(_0x448002,_0x27c2b5,_0x4ce9f7)=>{_0x4ce9f7||this[_0x11dc('0x1d')](null);}),this[_0x11dc('0x1c')](_0x19146c,_0x11dc('0x1a'),(_0x7cc125,_0x2191b0)=>{this['_removeAnnotationFromBalloon'](_0x2191b0),_0x2191b0===this[_0x11dc('0xe')]&&this[_0x11dc('0x1d')](null);}),this[_0x11dc('0x1c')](_0x107406,_0x11dc('0x44'),(_0x5c3a5b,_0x6b34b2,_0x6e2403,_0x264d89)=>{_0x264d89&&this[_0x11dc('0x16')](_0x264d89);const _0x13af38=_0x19146c['getByView'](_0x6e2403);_0x6e2403&&_0x13af38&&(this['listenTo'](_0x6e2403,_0x11dc('0x10'),()=>{_0x107406['updatePosition']();}),this[_0x11dc('0x1c')](_0x6e2403,_0x11dc('0x4'),()=>{this[_0x11dc('0x2a')](_0x13af38),this[_0x11dc('0x3e')][_0x11dc('0x43')][_0x11dc('0xa')][_0x11dc('0x32')]();}),this[_0x11dc('0xe')]!==_0x13af38&&this[_0x11dc('0x1d')](_0x13af38));}),this[_0x11dc('0x1c')](this[_0x11dc('0x3e')]['ui'],_0x11dc('0x15'),()=>{_0x107406['visibleView']&&(_0x19146c[_0x11dc('0x39')](_0x107406[_0x11dc('0x4d')])&&_0x107406[_0x11dc('0xd')]());}),this[_0x11dc('0x1c')](this[_0x11dc('0x3e')]['editing'][_0x11dc('0xa')]['document'],_0x11dc('0x2b'),()=>{this[_0x11dc('0x37')]=!0x0,this[_0x11dc('0x3d')][_0x11dc('0x46')]();}),this[_0x11dc('0x3e')][_0x11dc('0x43')]['view'][_0x11dc('0x35')][_0x11dc('0x14')][_0x11dc('0x8')]&&this[_0x11dc('0x3e')][_0x11dc('0x43')][_0x11dc('0xa')][_0x11dc('0x32')](),this[_0x11dc('0x7')]=!0x0;}[_0x11dc('0xf')](){if(!this[_0x11dc('0x7')])throw new _0x2606df(_0x11dc('0x31'),this);this[_0x11dc('0x1d')](null);for(const _0xcfb3da of this[_0x11dc('0x24')])this[_0x11dc('0x50')](_0xcfb3da);this[_0x11dc('0x16')](),this[_0x11dc('0x7')]=!0x1,this['annotations']=null;}[_0x11dc('0x1f')](){this[_0x11dc('0x7')]&&this['detach']();}[_0x11dc('0x2d')](_0x4c139c){for(const _0xb8a520 of this[_0x11dc('0x3a')])_0x4c139c[_0x11dc('0x2e')](_0xb8a520)||this['_manuallyClosed']['delete'](_0xb8a520);for(const _0x3d870e of this[_0x11dc('0x19')])_0x4c139c[_0x11dc('0x2e')](_0x3d870e)||this[_0x11dc('0x50')](_0x3d870e);if(this[_0x11dc('0x3e')]['ui'][_0x11dc('0x0')][_0x11dc('0x2f')])for(const _0x16d9db of _0x4c139c)this['_addAnnotationToBalloon'](_0x16d9db);this[_0x11dc('0x3a')]=_0x4c139c;}[_0x11dc('0x3')](_0x316563,_0x126f15=!0x1){this[_0x11dc('0x3d')]['has'](_0x316563)||(this['_addedAnnotations'][_0x11dc('0x18')](_0x316563)||this[_0x11dc('0x4f')][_0x11dc('0x6')](_0x316563[_0x11dc('0xa')])||(this['_addedAnnotations'][_0x11dc('0x4b')](_0x316563),this[_0x11dc('0x4f')][_0x11dc('0x4b')]({'stackId':_0x316563[_0x11dc('0xa')]['id'],'view':_0x316563['view'],'position':{'target':()=>this[_0x11dc('0x20')](_0x316563)}})),_0x126f15&&this['_balloon'][_0x11dc('0x41')](_0x316563[_0x11dc('0xa')]['id']));}[_0x11dc('0x20')](_0x1a5c8d){const _0x40b303=_0x1a5c8d[_0x11dc('0x1b')],_0x157aff=this[_0x11dc('0x3e')][_0x11dc('0x43')][_0x11dc('0xa')],_0x5a8d07=_0x157aff[_0x11dc('0x35')][_0x11dc('0x14')][_0x11dc('0x21')](),_0x15f0c1=_0x157aff[_0x11dc('0x34')][_0x11dc('0x5')](_0x5a8d07);if(_0x15f0c1['collapse'](!0x0),_0x40b303){if(_0x40b303 instanceof _0x559d6e)return _0x40b303;let _0xb5c670=[];for(const _0x8fb271 of _0x40b303)_0xb5c670['push'](...(_0x34a59f=_0x8fb271[_0x11dc('0x9')](),Array[_0x11dc('0x38')](_0x34a59f)[_0x11dc('0x12')](DOMRect[_0x11dc('0x26')])));_0xb5c670=function(_0x878bf8){const _0x55834b=[];let _0x5c79e3=_0x878bf8[0x0];for(let _0xf46029=0x1;_0xf46029<_0x878bf8[_0x11dc('0x3b')];_0xf46029++)F(_0x5c79e3,_0x878bf8[_0xf46029])?_0x5c79e3[_0x11dc('0x22')]+=_0x878bf8[_0xf46029][_0x11dc('0x22')]:(_0x55834b[_0x11dc('0x29')](_0x5c79e3),_0x5c79e3=_0x878bf8[_0xf46029]);return _0x55834b[_0x11dc('0x29')](_0x5c79e3),_0x55834b;}(_0xb5c670);const _0x31dac0=_0x15f0c1[_0x11dc('0x2c')]();return _0xb5c670[_0x11dc('0x36')](_0x966fd0=>_0x966fd0[_0x11dc('0x42')]<=_0x31dac0[_0x11dc('0x42')]&&_0x966fd0[_0x11dc('0x51')]>=_0x31dac0[_0x11dc('0x51')]&&_0x966fd0[_0x11dc('0x27')]<=_0x31dac0['left']&&_0x966fd0[_0x11dc('0x40')]>=_0x31dac0[_0x11dc('0x40')])||_0xb5c670[0x0];}var _0x34a59f;return _0x1a5c8d[_0x11dc('0x2')]||_0x15f0c1;}[_0x11dc('0x50')](_0x4d1f65){this[_0x11dc('0x24')][_0x11dc('0x18')](_0x4d1f65)&&this['_balloon'][_0x11dc('0x6')](_0x4d1f65[_0x11dc('0xa')])&&(this['_addedAnnotations'][_0x11dc('0x11')](_0x4d1f65),this['_balloon'][_0x11dc('0x1a')](_0x4d1f65['view']));}[_0x11dc('0x2a')](_0x830b4f){this['_manuallyClosed'][_0x11dc('0x4b')](_0x830b4f),this[_0x11dc('0x50')](_0x830b4f);}}function F(_0x1c639e,_0x3393b6){return _0x1c639e[_0x11dc('0x42')]===_0x3393b6[_0x11dc('0x42')]&&_0x1c639e['bottom']===_0x3393b6[_0x11dc('0x51')]&&_0x1c639e['right']===_0x3393b6['left'];}
|
|
@@ -1,80 +1,81 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/annotations/narrowsidebar
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { ContextPlugin, Context, type
|
|
6
|
-
import { type AnnotationsUI } from './annotationsuis';
|
|
7
|
-
import
|
|
8
|
-
import '
|
|
9
|
-
import
|
|
10
|
-
import type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* {@link module:comments/annotations/
|
|
16
|
-
* {@link module:comments/annotations/
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* {@link module:
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* editor.plugins.get( 'AnnotationsUIs' ).
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/narrowsidebar
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { ContextPlugin, Context, type Editor } from 'ckeditor5/src/core';
|
|
6
|
+
import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
|
|
7
|
+
import Sidebar from './sidebar';
|
|
8
|
+
import { BalloonPanelView, BodyCollection } from 'ckeditor5/src/ui';
|
|
9
|
+
import '../../theme/sidebar-narrow.css';
|
|
10
|
+
import type Annotation from './annotation';
|
|
11
|
+
import type { default as AnnotationCollection } from './annotationcollection';
|
|
12
|
+
/**
|
|
13
|
+
* The narrow sidebar UI for displaying annotations.
|
|
14
|
+
*
|
|
15
|
+
* Binds {@link module:comments/annotations/annotations~Annotations} plugin with
|
|
16
|
+
* {@link module:comments/annotations/sidebar~Sidebar} plugin to display annotations in the sidebar as
|
|
17
|
+
* {@link module:comments/annotations/view/annotationcounterbuttonview~AnnotationCounterButtonView small icons}.
|
|
18
|
+
*
|
|
19
|
+
* After selecting an annotation the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} with an
|
|
20
|
+
* {@link module:comments/annotations/view/annotationview~AnnotationView} appears attached to the sidebar item.
|
|
21
|
+
*
|
|
22
|
+
* This UI is intended for medium-sized viewports.
|
|
23
|
+
*
|
|
24
|
+
* To activate this UI use one of the following:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'narrowSidebar' );
|
|
28
|
+
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'narrowSidebar', filter );
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
32
|
+
*/
|
|
33
|
+
export default class NarrowSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
|
|
34
|
+
/**
|
|
35
|
+
* An active annotation tracked by this UI.
|
|
36
|
+
*/
|
|
37
|
+
activeAnnotation: Annotation | null;
|
|
38
|
+
bodyCollection: BodyCollection;
|
|
39
|
+
balloonPanelView: BalloonPanelView;
|
|
40
|
+
isAttached: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* A collection of annotations controlled by this UI.
|
|
43
|
+
*
|
|
44
|
+
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
45
|
+
*
|
|
46
|
+
* It is set to `null` if `NarrowSidebar` is not {@link module:comments/annotations/narrowsidebar~NarrowSidebar#attach attached}.
|
|
47
|
+
*/
|
|
48
|
+
annotations: AnnotationCollection | null;
|
|
49
|
+
/**
|
|
50
|
+
* @inheritDoc
|
|
51
|
+
*/
|
|
52
|
+
static get requires(): readonly [typeof Sidebar, typeof AnnotationsUIs];
|
|
53
|
+
/**
|
|
54
|
+
* @inheritDoc
|
|
55
|
+
*/
|
|
56
|
+
static get pluginName(): "NarrowSidebar";
|
|
57
|
+
/**
|
|
58
|
+
* @inheritDoc
|
|
59
|
+
*/
|
|
60
|
+
constructor(context: Context | Editor);
|
|
61
|
+
/**
|
|
62
|
+
* @inheritDoc
|
|
63
|
+
*/
|
|
64
|
+
init(): void;
|
|
65
|
+
/**
|
|
66
|
+
* @inheritDoc
|
|
67
|
+
*/
|
|
68
|
+
attach(annotations: AnnotationCollection): void;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the active annotation for this UI.
|
|
71
|
+
*/
|
|
72
|
+
setActiveAnnotation(annotation: Annotation | null): void;
|
|
73
|
+
/**
|
|
74
|
+
* @inheritDoc
|
|
75
|
+
*/
|
|
76
|
+
detach(): void;
|
|
77
|
+
/**
|
|
78
|
+
* @inheritDoc
|
|
79
|
+
*/
|
|
80
|
+
destroy(): void;
|
|
81
|
+
}
|