@ckeditor/ckeditor5-comments 40.0.0 → 40.2.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/CHANGELOG.md +19 -19
- package/LICENSE.md +3 -3
- package/README.md +1 -1
- 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/sq.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 +2 -0
- package/lang/translations/af.po +8 -0
- package/lang/translations/ar.po +8 -0
- package/lang/translations/bg.po +8 -0
- package/lang/translations/bn.po +8 -0
- package/lang/translations/bs.po +8 -0
- package/lang/translations/ca.po +8 -0
- package/lang/translations/cs.po +8 -0
- package/lang/translations/da.po +8 -0
- package/lang/translations/de-ch.po +8 -0
- package/lang/translations/de.po +8 -0
- package/lang/translations/el.po +8 -0
- package/lang/translations/en-au.po +8 -0
- package/lang/translations/en.po +8 -0
- package/lang/translations/es-co.po +8 -0
- package/lang/translations/es.po +8 -0
- package/lang/translations/et.po +8 -0
- package/lang/translations/fa.po +8 -0
- package/lang/translations/fi.po +8 -0
- package/lang/translations/fr.po +8 -0
- package/lang/translations/gl.po +8 -0
- package/lang/translations/he.po +8 -0
- package/lang/translations/hi.po +8 -0
- package/lang/translations/hr.po +8 -0
- package/lang/translations/hu.po +8 -0
- package/lang/translations/id.po +8 -0
- package/lang/translations/it.po +8 -0
- package/lang/translations/ja.po +8 -0
- package/lang/translations/jv.po +8 -0
- package/lang/translations/ko.po +8 -0
- package/lang/translations/lt.po +8 -0
- package/lang/translations/lv.po +8 -0
- package/lang/translations/ms.po +8 -0
- package/lang/translations/nl.po +8 -0
- package/lang/translations/no.po +8 -0
- package/lang/translations/pl.po +8 -0
- package/lang/translations/pt-br.po +8 -0
- package/lang/translations/pt.po +8 -0
- package/lang/translations/ro.po +8 -0
- package/lang/translations/ru.po +8 -0
- package/lang/translations/sk.po +8 -0
- package/lang/translations/sq.po +8 -0
- package/lang/translations/sr-latn.po +9 -1
- package/lang/translations/sr.po +8 -0
- package/lang/translations/sv.po +8 -0
- package/lang/translations/th.po +8 -0
- package/lang/translations/tk.po +8 -0
- package/lang/translations/tr.po +8 -0
- package/lang/translations/tt.po +8 -0
- package/lang/translations/ug.po +16 -8
- package/lang/translations/uk.po +8 -0
- package/lang/translations/ur.po +8 -0
- package/lang/translations/vi.po +8 -0
- package/lang/translations/zh-cn.po +8 -0
- package/lang/translations/zh.po +8 -0
- package/package.json +3 -3
- package/src/annotations/annotation.d.ts +90 -90
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.d.ts +98 -98
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.d.ts +154 -154
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.d.ts +232 -232
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +67 -67
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +90 -90
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +85 -85
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.d.ts +100 -100
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.d.ts +29 -29
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.d.ts +90 -90
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.d.ts +55 -55
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.d.ts +32 -32
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.d.ts +77 -77
- package/src/annotations/widesidebar.js +1 -1
- package/src/augmentation.d.ts +52 -52
- package/src/comments/addcommentthreadcommand.d.ts +35 -35
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.d.ts +31 -31
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.d.ts +38 -38
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.d.ts +79 -79
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1130 -1129
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +33 -33
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.d.ts +17 -17
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.d.ts +21 -21
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.d.ts +36 -36
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.d.ts +31 -31
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +36 -36
- package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
- package/src/comments/ui/commentthreadcontroller.d.ts +64 -64
- package/src/comments/ui/commentthreadcontroller.js +1 -1
- package/src/comments/ui/view/basecommentthreadview.d.ts +119 -119
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.d.ts +112 -112
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.d.ts +13 -13
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.d.ts +14 -14
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.d.ts +86 -86
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.d.ts +38 -38
- package/src/comments/ui/view/commentsarchiveview.js +1 -1
- package/src/comments/ui/view/commentslistview.d.ts +100 -100
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.d.ts +50 -50
- package/src/comments/ui/view/commentthreadheaderview.js +1 -1
- package/src/comments/ui/view/commentthreadinputview.d.ts +41 -41
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.d.ts +118 -118
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.d.ts +243 -243
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.d.ts +35 -35
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +33 -33
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +176 -176
- package/src/index.d.ts +24 -24
- package/src/utils/common-translations.d.ts +9 -9
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.d.ts +14 -14
- package/src/utils/createmutationobserver.js +1 -1
- package/theme/comment.css +1 -1
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module comments/annotations/editorannotations
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
10
|
-
import Annotations from './annotations';
|
|
11
|
-
import type Annotation from './annotation';
|
|
12
|
-
import type AnnotationCollection from './annotationcollection';
|
|
13
|
-
/**
|
|
14
|
-
* Integrates {@link module:comments/annotations/annotations~Annotations annotations} with the editor to provide proper behavior
|
|
15
|
-
* for annotations created through the editor features.
|
|
16
|
-
*
|
|
17
|
-
* *Note: The API of this class might change in the near future.*
|
|
18
|
-
*
|
|
19
|
-
* Collects all types of the annotations created through the editor features and their markers and decides which annotation is currently
|
|
20
|
-
* selected by the selection.
|
|
21
|
-
*
|
|
22
|
-
* Every editor plugin that adds an annotation should also
|
|
23
|
-
* {@link module:comments/annotations/editorannotations~EditorAnnotations#addSourceCollector register a callback}
|
|
24
|
-
* in which it will check whether given annotation should be marked as selected.
|
|
25
|
-
*/
|
|
26
|
-
export default class EditorAnnotations extends Plugin {
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get requires(): readonly [typeof Annotations];
|
|
31
|
-
/**
|
|
32
|
-
* @inheritDoc
|
|
33
|
-
*/
|
|
34
|
-
static get pluginName(): "EditorAnnotations";
|
|
35
|
-
/**
|
|
36
|
-
* @inheritDoc
|
|
37
|
-
*/
|
|
38
|
-
constructor(editor: Editor);
|
|
39
|
-
/**
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
init(): void;
|
|
43
|
-
/**
|
|
44
|
-
* Registers given annotation as an editor annotation, that is an annotation that is linked with a target inside the editor content.
|
|
45
|
-
*/
|
|
46
|
-
registerAnnotation(annotation: Annotation): void;
|
|
47
|
-
hasDomSelection(): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Registers a callback that collects annotations and their markers.
|
|
50
|
-
*/
|
|
51
|
-
addSourceCollector(callback: Function): void;
|
|
52
|
-
/**
|
|
53
|
-
* Finds all annotations selected by the editor selection and marks the most inner one as the active annotation.
|
|
54
|
-
*/
|
|
55
|
-
refreshSelectedViews(): void;
|
|
56
|
-
/**
|
|
57
|
-
* Finds all annotations for selected markers in order from the most inner marker to the most outer marker.
|
|
58
|
-
*
|
|
59
|
-
* @param options.annotations The collection of annotations for given UI.
|
|
60
|
-
* @param options.activeAnnotation The given UI active annotation.
|
|
61
|
-
* It is used to determine the order if the selection contains the active annotation's marker.
|
|
62
|
-
*/
|
|
63
|
-
getOrderedSelectedAnnotations({ activeAnnotation, annotations }: {
|
|
64
|
-
activeAnnotation: Annotation | null;
|
|
65
|
-
annotations: AnnotationCollection;
|
|
66
|
-
}): Array<Annotation>;
|
|
67
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module comments/annotations/editorannotations
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
10
|
+
import Annotations from './annotations';
|
|
11
|
+
import type Annotation from './annotation';
|
|
12
|
+
import type AnnotationCollection from './annotationcollection';
|
|
13
|
+
/**
|
|
14
|
+
* Integrates {@link module:comments/annotations/annotations~Annotations annotations} with the editor to provide proper behavior
|
|
15
|
+
* for annotations created through the editor features.
|
|
16
|
+
*
|
|
17
|
+
* *Note: The API of this class might change in the near future.*
|
|
18
|
+
*
|
|
19
|
+
* Collects all types of the annotations created through the editor features and their markers and decides which annotation is currently
|
|
20
|
+
* selected by the selection.
|
|
21
|
+
*
|
|
22
|
+
* Every editor plugin that adds an annotation should also
|
|
23
|
+
* {@link module:comments/annotations/editorannotations~EditorAnnotations#addSourceCollector register a callback}
|
|
24
|
+
* in which it will check whether given annotation should be marked as selected.
|
|
25
|
+
*/
|
|
26
|
+
export default class EditorAnnotations extends Plugin {
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get requires(): readonly [typeof Annotations];
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
static get pluginName(): "EditorAnnotations";
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
constructor(editor: Editor);
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
init(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Registers given annotation as an editor annotation, that is an annotation that is linked with a target inside the editor content.
|
|
45
|
+
*/
|
|
46
|
+
registerAnnotation(annotation: Annotation): void;
|
|
47
|
+
hasDomSelection(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Registers a callback that collects annotations and their markers.
|
|
50
|
+
*/
|
|
51
|
+
addSourceCollector(callback: Function): void;
|
|
52
|
+
/**
|
|
53
|
+
* Finds all annotations selected by the editor selection and marks the most inner one as the active annotation.
|
|
54
|
+
*/
|
|
55
|
+
refreshSelectedViews(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Finds all annotations for selected markers in order from the most inner marker to the most outer marker.
|
|
58
|
+
*
|
|
59
|
+
* @param options.annotations The collection of annotations for given UI.
|
|
60
|
+
* @param options.activeAnnotation The given UI active annotation.
|
|
61
|
+
* It is used to determine the order if the selection contains the active annotation's marker.
|
|
62
|
+
*/
|
|
63
|
+
getOrderedSelectedAnnotations({ activeAnnotation, annotations }: {
|
|
64
|
+
activeAnnotation: Annotation | null;
|
|
65
|
+
annotations: AnnotationCollection;
|
|
66
|
+
}): Array<Annotation>;
|
|
67
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x374c=['EditorAnnotations','_dataCollectors','innerView','sort','delete','annotation','init','isEqual','refresh','directChange','refreshSelectedViews','containsRange','uiUpdate','_editorAnnotations','selection','isCollapsed','map','model','addSourceCollector','has','function','listenTo','push','fire','_editorAnnotationsData','update','hasDomSelection','element','from','view','plugins','document','getOrderedSelectedAnnotations','cancel','set','get','editor','remove','blur','range','getRanges','focusTracker','registerAnnotation','add','change:range','editorannotations-invalid-source-callback','requires','editing'];(function(_0x482da0,_0x374c2a){const _0x320ba5=function(_0x3bd760){while(--_0x3bd760){_0x482da0['push'](_0x482da0['shift']());}};_0x320ba5(++_0x374c2a);}(_0x374c,0x193));const _0x320b=function(_0x482da0,_0x374c2a){_0x482da0=_0x482da0-0x0;let _0x320ba5=_0x374c[_0x482da0];return _0x320ba5;};import{Plugin as _0x5ba1d1}from'ckeditor5/src/core';import{CKEditorError as _0x1a5e54}from'ckeditor5/src/utils';import{debounce as _0x1ca270}from'lodash-es';import _0x591021 from'./annotations';export default class k extends _0x5ba1d1{static get[_0x320b('0x1b')](){return[_0x591021];}static get['pluginName'](){return _0x320b('0x1d');}constructor(_0x14f6bd){super(_0x14f6bd),this[_0x320b('0x1e')]=new Set(),this['_editorAnnotations']=new Set();}[_0x320b('0x23')](){const _0x3a3c61=this[_0x320b('0x11')],_0x278278=_0x3a3c61['model'][_0x320b('0xc')][_0x320b('0x2b')],_0x1ac8bf=_0x1ca270(()=>this[_0x320b('0x27')](),0xa);_0x278278['on'](_0x320b('0x19'),(_0x90a0d,_0x103352)=>{_0x103352[_0x320b('0x26')]&&(_0x1ac8bf[_0x320b('0xe')](),this[_0x320b('0x27')]());}),this['listenTo'](_0x3a3c61[_0x320b('0x1c')][_0x320b('0xa')]['document'],'change:isFocused',(_0x25e9e7,_0x29592e,_0x54381e)=>{_0x54381e&&_0x1ac8bf();}),this[_0x320b('0x2')](_0x3a3c61['ui'][_0x320b('0x16')],'change:isFocused',(_0x455b2d,_0x1c55dc,_0x52db03)=>{_0x52db03||_0x3a3c61['isReadOnly']||this[_0x320b('0x4')](_0x320b('0x13'),{'isAnnotationTracked':_0x5abafd=>this[_0x320b('0x5')]['has'](_0x5abafd[_0x320b('0x1f')])});}),this[_0x320b('0x2')](this[_0x320b('0x11')]['ui'],_0x320b('0x6'),()=>this[_0x320b('0x4')](_0x320b('0x29')));}[_0x320b('0x17')](_0x426fca){if(this[_0x320b('0x2a')][_0x320b('0x0')](_0x426fca['view']))return;this['_editorAnnotations'][_0x320b('0x18')](_0x426fca[_0x320b('0xa')]),this['editor']['ui'][_0x320b('0x16')][_0x320b('0x18')](_0x426fca[_0x320b('0xa')][_0x320b('0x8')]);const _0x23f0fa=this[_0x320b('0x11')][_0x320b('0xb')][_0x320b('0x10')](_0x591021);this[_0x320b('0x2')](_0x23f0fa['collection'],_0x320b('0x12'),(_0x4df9e3,_0x56f468)=>{this['editor']['ui'][_0x320b('0x16')][_0x320b('0x12')](_0x56f468[_0x320b('0xa')][_0x320b('0x8')]),this[_0x320b('0x2a')][_0x320b('0x21')](_0x56f468['view']);});}['hasDomSelection'](){return this['editor'][_0x320b('0x1c')][_0x320b('0xa')][_0x320b('0x7')];}[_0x320b('0x2f')](_0x17d7db){if(_0x320b('0x1')!=typeof _0x17d7db)throw new _0x1a5e54(_0x320b('0x1a'));this[_0x320b('0x1e')][_0x320b('0x18')](_0x17d7db);}[_0x320b('0x27')](){this['fire'](_0x320b('0x25'));}[_0x320b('0xd')]({activeAnnotation:_0x28303,annotations:_0x19f41e}){const _0xf79a3c=[],_0x2690b9=this[_0x320b('0x11')][_0x320b('0x2e')]['document'][_0x320b('0x2b')],_0x54330d=Array[_0x320b('0x9')](_0x2690b9[_0x320b('0x15')]());for(const [_0x4e68ef,_0x50954b]of this[_0x320b('0x5')]){const _0x3b40f2=_0x3fb158(_0x50954b),_0x442969=_0x19f41e['getByInnerView'](_0x4e68ef);_0x3b40f2&&_0x442969&&_0xf79a3c[_0x320b('0x3')]({'annotation':_0x442969,'range':_0x3b40f2});}function _0x3fb158(_0x5f12ac){for(const _0x449a28 of _0x5f12ac)for(const _0x48b5bf of _0x54330d)if(_0x449a28[_0x320b('0x28')](_0x48b5bf,!_0x2690b9[_0x320b('0x2c')]))return _0x449a28;return null;}return _0xf79a3c[_0x320b('0x20')]((_0x30d1b3,_0x7ba02d)=>{const _0x7aec88=_0x30d1b3['range'],_0x144bc5=_0x7ba02d[_0x320b('0x14')];if(!_0x7aec88[_0x320b('0x24')](_0x144bc5)){if(_0x7aec88[_0x320b('0x28')](_0x144bc5,!0x0))return 0x1;if(_0x144bc5[_0x320b('0x28')](_0x7aec88,!0x0))return-0x1;}return _0x30d1b3[_0x320b('0x22')]==_0x28303?-0x1:_0x7ba02d[_0x320b('0x22')]==_0x28303?0x1:0x0;})[_0x320b('0x2d')](_0x1956e7=>_0x1956e7[_0x320b('0x22')]);}get['_editorAnnotationsData'](){const _0x4afad9=new Map();for(const _0x24be49 of Array[_0x320b('0x9')](this['_dataCollectors']))for(const [_0x51b928,_0x3b481c]of _0x24be49())_0x4afad9[_0x320b('0xf')](_0x51b928,_0x3b481c);return _0x4afad9;}}
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module comments/annotations/inlineannotations
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
10
|
-
import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
|
|
11
|
-
import EditorAnnotations from './editorannotations';
|
|
12
|
-
import { ContextualBalloon } from 'ckeditor5/src/ui';
|
|
13
|
-
import './../../theme/annotation-inline.css';
|
|
14
|
-
import type Annotation from './annotation';
|
|
15
|
-
import type AnnotationCollection from './annotationcollection';
|
|
16
|
-
/**
|
|
17
|
-
* The popup-style UI for displaying annotations next to editor target elements.
|
|
18
|
-
*
|
|
19
|
-
* It displays {@link module:comments/annotations/annotation~Annotation annotations} in the
|
|
20
|
-
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon balloon} where the current
|
|
21
|
-
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#activeAnnotation} is the displayed one.
|
|
22
|
-
*
|
|
23
|
-
* Note: this UI type works only with {@link module:core/editor/editor~Editor the Editor} and cannot be used in integrations where
|
|
24
|
-
* there is only {@link module:core/context~Context context} without any editor.
|
|
25
|
-
*
|
|
26
|
-
* This UI is intended for narrow screens.
|
|
27
|
-
*
|
|
28
|
-
* To activate this UI use one of the following:
|
|
29
|
-
*
|
|
30
|
-
* ```ts
|
|
31
|
-
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'inline' );
|
|
32
|
-
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'inline', filter );
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
36
|
-
*/
|
|
37
|
-
export default class InlineAnnotations extends Plugin implements AnnotationsUI<Plugin> {
|
|
38
|
-
/**
|
|
39
|
-
* An active annotation tracked by this UI.
|
|
40
|
-
*
|
|
41
|
-
* @observable
|
|
42
|
-
*/
|
|
43
|
-
activeAnnotation: Annotation | null;
|
|
44
|
-
isAttached: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* A collection of annotations controlled by this UI.
|
|
47
|
-
*
|
|
48
|
-
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
49
|
-
*
|
|
50
|
-
* It is set to `null` if `InlineAnnotations` is not
|
|
51
|
-
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#attach attached}.
|
|
52
|
-
*/
|
|
53
|
-
annotations: AnnotationCollection | null;
|
|
54
|
-
/**
|
|
55
|
-
* @inheritDoc
|
|
56
|
-
*/
|
|
57
|
-
static get requires(): readonly [typeof EditorAnnotations, typeof ContextualBalloon, typeof AnnotationsUIs];
|
|
58
|
-
/**
|
|
59
|
-
* @inheritDoc
|
|
60
|
-
*/
|
|
61
|
-
static get pluginName(): "InlineAnnotations";
|
|
62
|
-
/**
|
|
63
|
-
* @inheritDoc
|
|
64
|
-
*/
|
|
65
|
-
constructor(editor: Editor);
|
|
66
|
-
/**
|
|
67
|
-
* @inheritDoc
|
|
68
|
-
*/
|
|
69
|
-
init(): void;
|
|
70
|
-
/**
|
|
71
|
-
* @inheritDoc
|
|
72
|
-
*/
|
|
73
|
-
afterInit(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Sets the active annotation for this UI.
|
|
76
|
-
*/
|
|
77
|
-
setActiveAnnotation(annotation: Annotation | null): void;
|
|
78
|
-
/**
|
|
79
|
-
* @inheritDoc
|
|
80
|
-
*/
|
|
81
|
-
attach(annotations: AnnotationCollection): void;
|
|
82
|
-
/**
|
|
83
|
-
* @inheritDoc
|
|
84
|
-
*/
|
|
85
|
-
detach(): void;
|
|
86
|
-
/**
|
|
87
|
-
* @inheritDoc
|
|
88
|
-
*/
|
|
89
|
-
destroy(): void;
|
|
90
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module comments/annotations/inlineannotations
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
10
|
+
import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
|
|
11
|
+
import EditorAnnotations from './editorannotations';
|
|
12
|
+
import { ContextualBalloon } from 'ckeditor5/src/ui';
|
|
13
|
+
import './../../theme/annotation-inline.css';
|
|
14
|
+
import type Annotation from './annotation';
|
|
15
|
+
import type AnnotationCollection from './annotationcollection';
|
|
16
|
+
/**
|
|
17
|
+
* The popup-style UI for displaying annotations next to editor target elements.
|
|
18
|
+
*
|
|
19
|
+
* It displays {@link module:comments/annotations/annotation~Annotation annotations} in the
|
|
20
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon balloon} where the current
|
|
21
|
+
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#activeAnnotation} is the displayed one.
|
|
22
|
+
*
|
|
23
|
+
* Note: this UI type works only with {@link module:core/editor/editor~Editor the Editor} and cannot be used in integrations where
|
|
24
|
+
* there is only {@link module:core/context~Context context} without any editor.
|
|
25
|
+
*
|
|
26
|
+
* This UI is intended for narrow screens.
|
|
27
|
+
*
|
|
28
|
+
* To activate this UI use one of the following:
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'inline' );
|
|
32
|
+
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'inline', filter );
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
36
|
+
*/
|
|
37
|
+
export default class InlineAnnotations extends Plugin implements AnnotationsUI<Plugin> {
|
|
38
|
+
/**
|
|
39
|
+
* An active annotation tracked by this UI.
|
|
40
|
+
*
|
|
41
|
+
* @observable
|
|
42
|
+
*/
|
|
43
|
+
activeAnnotation: Annotation | null;
|
|
44
|
+
isAttached: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* A collection of annotations controlled by this UI.
|
|
47
|
+
*
|
|
48
|
+
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
49
|
+
*
|
|
50
|
+
* It is set to `null` if `InlineAnnotations` is not
|
|
51
|
+
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#attach attached}.
|
|
52
|
+
*/
|
|
53
|
+
annotations: AnnotationCollection | null;
|
|
54
|
+
/**
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
*/
|
|
57
|
+
static get requires(): readonly [typeof EditorAnnotations, typeof ContextualBalloon, typeof AnnotationsUIs];
|
|
58
|
+
/**
|
|
59
|
+
* @inheritDoc
|
|
60
|
+
*/
|
|
61
|
+
static get pluginName(): "InlineAnnotations";
|
|
62
|
+
/**
|
|
63
|
+
* @inheritDoc
|
|
64
|
+
*/
|
|
65
|
+
constructor(editor: Editor);
|
|
66
|
+
/**
|
|
67
|
+
* @inheritDoc
|
|
68
|
+
*/
|
|
69
|
+
init(): void;
|
|
70
|
+
/**
|
|
71
|
+
* @inheritDoc
|
|
72
|
+
*/
|
|
73
|
+
afterInit(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Sets the active annotation for this UI.
|
|
76
|
+
*/
|
|
77
|
+
setActiveAnnotation(annotation: Annotation | null): void;
|
|
78
|
+
/**
|
|
79
|
+
* @inheritDoc
|
|
80
|
+
*/
|
|
81
|
+
attach(annotations: AnnotationCollection): void;
|
|
82
|
+
/**
|
|
83
|
+
* @inheritDoc
|
|
84
|
+
*/
|
|
85
|
+
detach(): void;
|
|
86
|
+
/**
|
|
87
|
+
* @inheritDoc
|
|
88
|
+
*/
|
|
89
|
+
destroy(): void;
|
|
90
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x3590=['keystrokes','editing','domConverter','refresh','annotations','activeAnnotation','clear','_setSelectedAnnotations','setActiveAnnotation','set','find','switchTo','selection','pluginName','length','editableElement','getFirstRange','includes','_getBalloonTargetForAnnotation','left','_closeAnnotation','_selectedAnnotations','listenTo','getByView','fromRect','isFocused','change:height','every','targetRect','has','focusTracker','inlineannotations-attach-already-attached','requires','_manuallyClosed','collapse','remove','target','attach','document','init','right','focus','blur','_forceRefresh','updatePosition','plugins','register','add','_addedAnnotations','InlineAnnotations','visibleView','push','update','Esc','getOrderedSelectedAnnotations','delete','get','inline','destroy','view','top','detach','getBoundingClientRect','width','inlineannotations-not-allowed-with-context','inlineannotations-detach-not-attached','afterInit','change:visibleView','_addAnnotationToBalloon','bottom','context','isAttached','hasActive','editor','hasView','isActive','stopListening','_removeAnnotationFromBalloon','_balloon'];(function(_0x4cdc3e,_0x3590a0){const _0x1b184d=function(_0x2cd4bd){while(--_0x2cd4bd){_0x4cdc3e['push'](_0x4cdc3e['shift']());}};_0x1b184d(++_0x3590a0);}(_0x3590,0x1a7));const _0x1b18=function(_0x4cdc3e,_0x3590a0){_0x4cdc3e=_0x4cdc3e-0x0;let _0x1b184d=_0x3590[_0x4cdc3e];return _0x1b184d;};import{Plugin as _0x27bcc6}from'ckeditor5/src/core';import _0x51c007 from'./annotationsuis';import _0x2bd586 from'./editorannotations';import{ContextualBalloon as _0x30d8cc}from'ckeditor5/src/ui';import{MouseObserver as _0x4b5a78}from'ckeditor5/src/engine';import{CKEditorError as _0x2b22e0,Rect as _0x369551}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x27bcc6{static get[_0x1b18('0x4')](){return[_0x2bd586,_0x30d8cc,_0x51c007];}static get[_0x1b18('0x40')](){return _0x1b18('0x15');}constructor(_0x49940b){super(_0x49940b),_0x49940b[_0x1b18('0x34')][_0x1b18('0x1f')]['addObserver'](_0x4b5a78),this[_0x1b18('0x2b')]=!0x1,this[_0x1b18('0x3c')](_0x1b18('0x38'),null),this[_0x1b18('0x37')]=null,this['_manuallyClosed']=new Set(),this[_0x1b18('0x32')]=_0x49940b[_0x1b18('0x11')][_0x1b18('0x1c')](_0x30d8cc),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this['_forceRefresh']=!0x1;}[_0x1b18('0xb')](){const _0x441251=this[_0x1b18('0x2d')][_0x1b18('0x11')][_0x1b18('0x1c')](_0x51c007);_0x441251[_0x1b18('0x2a')]===this[_0x1b18('0x2d')]&&(_0x441251[_0x1b18('0x12')]('inline',this),this['editor'][_0x1b18('0x33')]['set'](_0x1b18('0x19'),(_0xc15a5c,_0xe1b553)=>{const _0x2689d3=this[_0x1b18('0x32')];if(this[_0x1b18('0x2b')]&&_0x2689d3[_0x1b18('0x16')]){const _0x1ecb31=this[_0x1b18('0x37')][_0x1b18('0x4a')](_0x2689d3[_0x1b18('0x16')]);_0x1ecb31&&this[_0x1b18('0x47')](_0x1ecb31),_0xe1b553();}}));}[_0x1b18('0x26')](){const _0x47686f=this['editor'][_0x1b18('0x11')][_0x1b18('0x1c')](_0x51c007);_0x47686f['context']===this[_0x1b18('0x2d')]&&(_0x47686f[_0x1b18('0x2c')]()||_0x47686f[_0x1b18('0x3e')](_0x1b18('0x1d')));}[_0x1b18('0x3b')](_0x21d0e1){_0x21d0e1!==this['activeAnnotation']&&(this[_0x1b18('0x38')]&&(this['activeAnnotation'][_0x1b18('0x2f')]=!0x1),_0x21d0e1&&this[_0x1b18('0x2d')]['ui'][_0x1b18('0x2')][_0x1b18('0x4c')]&&(this[_0x1b18('0x37')][_0x1b18('0x1')](_0x21d0e1)&&this[_0x1b18('0x28')](_0x21d0e1,!0x0),_0x21d0e1[_0x1b18('0x2f')]=!0x0),_0x21d0e1||this[_0x1b18('0x3a')]([]),this['activeAnnotation']=_0x21d0e1);}[_0x1b18('0x9')](_0x906d44){this[_0x1b18('0x37')]=_0x906d44;const _0x297406=this[_0x1b18('0x2d')][_0x1b18('0x11')]['get'](_0x51c007),_0x564dca=this[_0x1b18('0x32')];if(this[_0x1b18('0x2b')])throw new _0x2b22e0(_0x1b18('0x3'),this);if(_0x297406[_0x1b18('0x2a')]!==this['editor'])throw new _0x2b22e0(_0x1b18('0x24'),this);const _0x591107=this[_0x1b18('0x2d')][_0x1b18('0x11')]['get'](_0x2bd586);this['listenTo'](_0x591107,_0x1b18('0x36'),()=>{const _0x214acc=_0x591107[_0x1b18('0x1a')]({'annotations':this['annotations'],'activeAnnotation':this[_0x1b18('0x38')]});var _0x272b3e,_0x4d74a0;!this['_forceRefresh']&&(_0x272b3e=_0x214acc,_0x4d74a0=this['_selectedAnnotations'],_0x272b3e[_0x1b18('0x41')]===_0x4d74a0[_0x1b18('0x41')]&&_0x272b3e[_0x1b18('0x4e')](_0x23ca19=>_0x4d74a0[_0x1b18('0x44')](_0x23ca19)))||(this[_0x1b18('0xf')]=!0x1,this[_0x1b18('0x3a')](_0x214acc),this[_0x1b18('0x3b')](_0x214acc[0x0]||null));}),this['listenTo'](_0x591107,_0x1b18('0xe'),(_0x7f77f5,{isAnnotationTracked:_0x352aa7})=>{this[_0x1b18('0x38')]&&_0x352aa7(this[_0x1b18('0x38')])&&(this[_0x1b18('0x3a')]([]),this[_0x1b18('0x3b')](null));}),this[_0x1b18('0x49')](this[_0x1b18('0x2d')]['ui']['focusTracker'],'change:isFocused',(_0x3012c2,_0x30cd2b,_0x95c32e)=>{_0x95c32e||this[_0x1b18('0x3b')](null);}),this['listenTo'](_0x906d44,_0x1b18('0x7'),(_0x112ffc,_0x145b9d)=>{this[_0x1b18('0x31')](_0x145b9d),_0x145b9d===this[_0x1b18('0x38')]&&this['setActiveAnnotation'](null);}),this[_0x1b18('0x49')](_0x564dca,_0x1b18('0x27'),(_0x54cff4,_0x5150d4,_0xb8c947,_0x5c195d)=>{_0x5c195d&&this[_0x1b18('0x30')](_0x5c195d);const _0x1d8422=_0x906d44[_0x1b18('0x4a')](_0xb8c947);_0xb8c947&&_0x1d8422&&(this['listenTo'](_0xb8c947,_0x1b18('0x4d'),()=>{_0x564dca[_0x1b18('0x10')]();}),this['listenTo'](_0xb8c947,_0x1b18('0x19'),()=>{this[_0x1b18('0x47')](_0x1d8422),this[_0x1b18('0x2d')][_0x1b18('0x34')][_0x1b18('0x1f')]['focus']();}),this[_0x1b18('0x38')]!==_0x1d8422&&this['setActiveAnnotation'](_0x1d8422));}),this['listenTo'](this[_0x1b18('0x2d')]['ui'],_0x1b18('0x18'),()=>{_0x564dca[_0x1b18('0x16')]&&(_0x906d44['getByView'](_0x564dca['visibleView'])&&_0x564dca[_0x1b18('0x10')]());}),this[_0x1b18('0x49')](this[_0x1b18('0x2d')][_0x1b18('0x34')]['view']['document'],'mousedown',()=>{this['_forceRefresh']=!0x0,this['_manuallyClosed'][_0x1b18('0x39')]();}),this[_0x1b18('0x2d')][_0x1b18('0x34')][_0x1b18('0x1f')][_0x1b18('0xa')][_0x1b18('0x3f')][_0x1b18('0x42')]&&this['editor'][_0x1b18('0x34')]['view'][_0x1b18('0xd')](),this[_0x1b18('0x2b')]=!0x0;}[_0x1b18('0x21')](){if(!this[_0x1b18('0x2b')])throw new _0x2b22e0(_0x1b18('0x25'),this);this['setActiveAnnotation'](null);for(const _0x7e50b9 of this['_addedAnnotations'])this[_0x1b18('0x31')](_0x7e50b9);this[_0x1b18('0x30')](),this['isAttached']=!0x1,this[_0x1b18('0x37')]=null;}[_0x1b18('0x1e')](){this['isAttached']&&this[_0x1b18('0x21')]();}[_0x1b18('0x3a')](_0x412cd8){for(const _0x1189e0 of this[_0x1b18('0x48')])_0x412cd8['includes'](_0x1189e0)||this[_0x1b18('0x5')][_0x1b18('0x1b')](_0x1189e0);for(const _0x191caa of this[_0x1b18('0x37')])_0x412cd8[_0x1b18('0x44')](_0x191caa)||this[_0x1b18('0x31')](_0x191caa);if(this['editor']['ui']['focusTracker'][_0x1b18('0x4c')])for(const _0x316e23 of _0x412cd8)this[_0x1b18('0x28')](_0x316e23);this['_selectedAnnotations']=_0x412cd8;}[_0x1b18('0x28')](_0x29c971,_0x55827c=!0x1){this['_manuallyClosed'][_0x1b18('0x1')](_0x29c971)||(this[_0x1b18('0x14')]['has'](_0x29c971)||this[_0x1b18('0x32')]['hasView'](_0x29c971[_0x1b18('0x1f')])||(this['_addedAnnotations'][_0x1b18('0x13')](_0x29c971),this[_0x1b18('0x32')]['add']({'stackId':_0x29c971[_0x1b18('0x1f')]['id'],'view':_0x29c971[_0x1b18('0x1f')],'position':{'target':()=>this[_0x1b18('0x45')](_0x29c971)}})),_0x55827c&&this[_0x1b18('0x32')]['showStack'](_0x29c971['view']['id']));}['_getBalloonTargetForAnnotation'](_0x183787){const _0x45dfb7=_0x183787[_0x1b18('0x8')],_0x31159f=this[_0x1b18('0x2d')]['editing'][_0x1b18('0x1f')],_0x1cacb8=_0x31159f[_0x1b18('0xa')]['selection'][_0x1b18('0x43')](),_0x4a9bb6=_0x31159f[_0x1b18('0x35')]['viewRangeToDom'](_0x1cacb8);if(_0x4a9bb6[_0x1b18('0x6')](!0x0),_0x45dfb7){if(_0x45dfb7 instanceof _0x369551)return _0x45dfb7;let _0x2d527c=[];for(const _0x2f0107 of _0x45dfb7)_0x2d527c[_0x1b18('0x17')](...(_0xb84257=_0x2f0107['getClientRects'](),Array['from'](_0xb84257)['map'](DOMRect[_0x1b18('0x4b')])));_0x2d527c=function(_0x47e7b5){const _0x20012a=[];let _0xe3faa3=_0x47e7b5[0x0];for(let _0x2a1888=0x1;_0x2a1888<_0x47e7b5['length'];_0x2a1888++)F(_0xe3faa3,_0x47e7b5[_0x2a1888])?_0xe3faa3[_0x1b18('0x23')]+=_0x47e7b5[_0x2a1888][_0x1b18('0x23')]:(_0x20012a[_0x1b18('0x17')](_0xe3faa3),_0xe3faa3=_0x47e7b5[_0x2a1888]);return _0x20012a[_0x1b18('0x17')](_0xe3faa3),_0x20012a;}(_0x2d527c);const _0x538bf8=_0x4a9bb6[_0x1b18('0x22')]();return _0x2d527c[_0x1b18('0x3d')](_0x49ddc0=>_0x49ddc0[_0x1b18('0x20')]<=_0x538bf8[_0x1b18('0x20')]&&_0x49ddc0['bottom']>=_0x538bf8[_0x1b18('0x29')]&&_0x49ddc0['left']<=_0x538bf8['left']&&_0x49ddc0[_0x1b18('0xc')]>=_0x538bf8[_0x1b18('0xc')])||_0x2d527c[0x0];}var _0xb84257;return _0x183787[_0x1b18('0x0')]||_0x4a9bb6;}[_0x1b18('0x31')](_0x3dc7bd){this[_0x1b18('0x14')]['has'](_0x3dc7bd)&&this[_0x1b18('0x32')][_0x1b18('0x2e')](_0x3dc7bd[_0x1b18('0x1f')])&&(this[_0x1b18('0x14')][_0x1b18('0x1b')](_0x3dc7bd),this[_0x1b18('0x32')]['remove'](_0x3dc7bd[_0x1b18('0x1f')]));}[_0x1b18('0x47')](_0x2fd039){this[_0x1b18('0x5')][_0x1b18('0x13')](_0x2fd039),this[_0x1b18('0x31')](_0x2fd039);}}function F(_0x588b82,_0x332738){return _0x588b82['top']===_0x332738[_0x1b18('0x20')]&&_0x588b82[_0x1b18('0x29')]===_0x332738[_0x1b18('0x29')]&&_0x588b82['right']===_0x332738[_0x1b18('0x46')];}
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module comments/annotations/narrowsidebar
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { ContextPlugin, Context, type Editor } from 'ckeditor5/src/core';
|
|
10
|
-
import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
|
|
11
|
-
import Sidebar from './sidebar';
|
|
12
|
-
import { BalloonPanelView, BodyCollection } from 'ckeditor5/src/ui';
|
|
13
|
-
import '../../theme/sidebar-narrow.css';
|
|
14
|
-
import type Annotation from './annotation';
|
|
15
|
-
import type { default as AnnotationCollection } from './annotationcollection';
|
|
16
|
-
/**
|
|
17
|
-
* The narrow sidebar UI for displaying annotations.
|
|
18
|
-
*
|
|
19
|
-
* Binds {@link module:comments/annotations/annotations~Annotations} plugin with
|
|
20
|
-
* {@link module:comments/annotations/sidebar~Sidebar} plugin to display annotations in the sidebar as
|
|
21
|
-
* {@link module:comments/annotations/view/annotationcounterbuttonview~AnnotationCounterButtonView small icons}.
|
|
22
|
-
*
|
|
23
|
-
* After selecting an annotation the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} with an
|
|
24
|
-
* {@link module:comments/annotations/view/annotationview~AnnotationView} appears attached to the sidebar item.
|
|
25
|
-
*
|
|
26
|
-
* This UI is intended for medium-sized viewports.
|
|
27
|
-
*
|
|
28
|
-
* To activate this UI use one of the following:
|
|
29
|
-
*
|
|
30
|
-
* ```ts
|
|
31
|
-
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'narrowSidebar' );
|
|
32
|
-
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'narrowSidebar', filter );
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
36
|
-
*/
|
|
37
|
-
export default class NarrowSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
|
|
38
|
-
/**
|
|
39
|
-
* An active annotation tracked by this UI.
|
|
40
|
-
*/
|
|
41
|
-
activeAnnotation: Annotation | null;
|
|
42
|
-
bodyCollection: BodyCollection;
|
|
43
|
-
balloonPanelView: BalloonPanelView;
|
|
44
|
-
isAttached: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* A collection of annotations controlled by this UI.
|
|
47
|
-
*
|
|
48
|
-
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
49
|
-
*
|
|
50
|
-
* It is set to `null` if `NarrowSidebar` is not {@link module:comments/annotations/narrowsidebar~NarrowSidebar#attach attached}.
|
|
51
|
-
*/
|
|
52
|
-
annotations: AnnotationCollection | null;
|
|
53
|
-
/**
|
|
54
|
-
* @inheritDoc
|
|
55
|
-
*/
|
|
56
|
-
static get requires(): readonly [typeof Sidebar, typeof AnnotationsUIs];
|
|
57
|
-
/**
|
|
58
|
-
* @inheritDoc
|
|
59
|
-
*/
|
|
60
|
-
static get pluginName(): "NarrowSidebar";
|
|
61
|
-
/**
|
|
62
|
-
* @inheritDoc
|
|
63
|
-
*/
|
|
64
|
-
constructor(context: Context | Editor);
|
|
65
|
-
/**
|
|
66
|
-
* @inheritDoc
|
|
67
|
-
*/
|
|
68
|
-
init(): void;
|
|
69
|
-
/**
|
|
70
|
-
* @inheritDoc
|
|
71
|
-
*/
|
|
72
|
-
attach(annotations: AnnotationCollection): void;
|
|
73
|
-
/**
|
|
74
|
-
* Sets the active annotation for this UI.
|
|
75
|
-
*/
|
|
76
|
-
setActiveAnnotation(annotation: Annotation | null): void;
|
|
77
|
-
/**
|
|
78
|
-
* @inheritDoc
|
|
79
|
-
*/
|
|
80
|
-
detach(): void;
|
|
81
|
-
/**
|
|
82
|
-
* @inheritDoc
|
|
83
|
-
*/
|
|
84
|
-
destroy(): void;
|
|
85
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module comments/annotations/narrowsidebar
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ContextPlugin, Context, type Editor } from 'ckeditor5/src/core';
|
|
10
|
+
import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
|
|
11
|
+
import Sidebar from './sidebar';
|
|
12
|
+
import { BalloonPanelView, BodyCollection } from 'ckeditor5/src/ui';
|
|
13
|
+
import '../../theme/sidebar-narrow.css';
|
|
14
|
+
import type Annotation from './annotation';
|
|
15
|
+
import type { default as AnnotationCollection } from './annotationcollection';
|
|
16
|
+
/**
|
|
17
|
+
* The narrow sidebar UI for displaying annotations.
|
|
18
|
+
*
|
|
19
|
+
* Binds {@link module:comments/annotations/annotations~Annotations} plugin with
|
|
20
|
+
* {@link module:comments/annotations/sidebar~Sidebar} plugin to display annotations in the sidebar as
|
|
21
|
+
* {@link module:comments/annotations/view/annotationcounterbuttonview~AnnotationCounterButtonView small icons}.
|
|
22
|
+
*
|
|
23
|
+
* After selecting an annotation the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} with an
|
|
24
|
+
* {@link module:comments/annotations/view/annotationview~AnnotationView} appears attached to the sidebar item.
|
|
25
|
+
*
|
|
26
|
+
* This UI is intended for medium-sized viewports.
|
|
27
|
+
*
|
|
28
|
+
* To activate this UI use one of the following:
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'narrowSidebar' );
|
|
32
|
+
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'narrowSidebar', filter );
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
36
|
+
*/
|
|
37
|
+
export default class NarrowSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
|
|
38
|
+
/**
|
|
39
|
+
* An active annotation tracked by this UI.
|
|
40
|
+
*/
|
|
41
|
+
activeAnnotation: Annotation | null;
|
|
42
|
+
bodyCollection: BodyCollection;
|
|
43
|
+
balloonPanelView: BalloonPanelView;
|
|
44
|
+
isAttached: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* A collection of annotations controlled by this UI.
|
|
47
|
+
*
|
|
48
|
+
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
49
|
+
*
|
|
50
|
+
* It is set to `null` if `NarrowSidebar` is not {@link module:comments/annotations/narrowsidebar~NarrowSidebar#attach attached}.
|
|
51
|
+
*/
|
|
52
|
+
annotations: AnnotationCollection | null;
|
|
53
|
+
/**
|
|
54
|
+
* @inheritDoc
|
|
55
|
+
*/
|
|
56
|
+
static get requires(): readonly [typeof Sidebar, typeof AnnotationsUIs];
|
|
57
|
+
/**
|
|
58
|
+
* @inheritDoc
|
|
59
|
+
*/
|
|
60
|
+
static get pluginName(): "NarrowSidebar";
|
|
61
|
+
/**
|
|
62
|
+
* @inheritDoc
|
|
63
|
+
*/
|
|
64
|
+
constructor(context: Context | Editor);
|
|
65
|
+
/**
|
|
66
|
+
* @inheritDoc
|
|
67
|
+
*/
|
|
68
|
+
init(): void;
|
|
69
|
+
/**
|
|
70
|
+
* @inheritDoc
|
|
71
|
+
*/
|
|
72
|
+
attach(annotations: AnnotationCollection): void;
|
|
73
|
+
/**
|
|
74
|
+
* Sets the active annotation for this UI.
|
|
75
|
+
*/
|
|
76
|
+
setActiveAnnotation(annotation: Annotation | null): void;
|
|
77
|
+
/**
|
|
78
|
+
* @inheritDoc
|
|
79
|
+
*/
|
|
80
|
+
detach(): void;
|
|
81
|
+
/**
|
|
82
|
+
* @inheritDoc
|
|
83
|
+
*/
|
|
84
|
+
destroy(): void;
|
|
85
|
+
}
|