@ckeditor/ckeditor5-comments 40.0.0 → 40.1.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/LICENSE.md +3 -3
- 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 +8 -0
- 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 +8 -0
- 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 +1129 -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 _0x55ca=['add','isEqual','_editorAnnotationsData','_editorAnnotations','containsRange','EditorAnnotations','get','set','remove','collection','fire','element','cancel','requires','init','plugins','selection','blur','editorannotations-invalid-source-callback','document','push','editing','directChange','view','model','editor','pluginName','from','has','sort','change:isFocused','hasDomSelection','addSourceCollector','registerAnnotation','isReadOnly','_dataCollectors','listenTo','getRanges','update','focusTracker','uiUpdate','change:range','function','range','refreshSelectedViews','refresh','annotation','innerView','getOrderedSelectedAnnotations'];(function(_0x1d8972,_0x55ca5f){const _0x506895=function(_0x3a1464){while(--_0x3a1464){_0x1d8972['push'](_0x1d8972['shift']());}};_0x506895(++_0x55ca5f);}(_0x55ca,0xe0));const _0x5068=function(_0x1d8972,_0x55ca5f){_0x1d8972=_0x1d8972-0x0;let _0x506895=_0x55ca[_0x1d8972];return _0x506895;};import{Plugin as _0x494aa4}from'ckeditor5/src/core';import{CKEditorError as _0x574ef8}from'ckeditor5/src/utils';import{debounce as _0x5e5713}from'lodash-es';import _0x5a0592 from'./annotations';export default class k extends _0x494aa4{static get[_0x5068('0x22')](){return[_0x5a0592];}static get[_0x5068('0x2f')](){return _0x5068('0x1a');}constructor(_0x294844){super(_0x294844),this['_dataCollectors']=new Set(),this[_0x5068('0x18')]=new Set();}[_0x5068('0x23')](){const _0x3a87d7=this[_0x5068('0x2e')],_0x67d997=_0x3a87d7[_0x5068('0x2d')][_0x5068('0x28')][_0x5068('0x25')],_0x102272=_0x5e5713(()=>this[_0x5068('0x10')](),0xa);_0x67d997['on'](_0x5068('0xd'),(_0x42e52f,_0x54ddb5)=>{_0x54ddb5[_0x5068('0x2b')]&&(_0x102272[_0x5068('0x21')](),this[_0x5068('0x10')]());}),this[_0x5068('0x8')](_0x3a87d7['editing']['view'][_0x5068('0x28')],_0x5068('0x2'),(_0x3b0b98,_0x1dc498,_0x4b03af)=>{_0x4b03af&&_0x102272();}),this[_0x5068('0x8')](_0x3a87d7['ui'][_0x5068('0xb')],'change:isFocused',(_0x58219a,_0x9b9043,_0x276a94)=>{_0x276a94||_0x3a87d7[_0x5068('0x6')]||this[_0x5068('0x1f')](_0x5068('0x26'),{'isAnnotationTracked':_0x147be0=>this[_0x5068('0x17')]['has'](_0x147be0[_0x5068('0x13')])});}),this['listenTo'](this[_0x5068('0x2e')]['ui'],_0x5068('0xa'),()=>this[_0x5068('0x1f')](_0x5068('0xc')));}[_0x5068('0x5')](_0x17d613){if(this['_editorAnnotations'][_0x5068('0x0')](_0x17d613[_0x5068('0x2c')]))return;this[_0x5068('0x18')][_0x5068('0x15')](_0x17d613['view']),this[_0x5068('0x2e')]['ui']['focusTracker'][_0x5068('0x15')](_0x17d613[_0x5068('0x2c')][_0x5068('0x20')]);const _0x4b6fa0=this[_0x5068('0x2e')][_0x5068('0x24')][_0x5068('0x1b')](_0x5a0592);this['listenTo'](_0x4b6fa0[_0x5068('0x1e')],_0x5068('0x1d'),(_0x426107,_0xea02a4)=>{this[_0x5068('0x2e')]['ui'][_0x5068('0xb')]['remove'](_0xea02a4[_0x5068('0x2c')][_0x5068('0x20')]),this[_0x5068('0x18')]['delete'](_0xea02a4[_0x5068('0x2c')]);});}[_0x5068('0x3')](){return this[_0x5068('0x2e')][_0x5068('0x2a')][_0x5068('0x2c')][_0x5068('0x3')];}[_0x5068('0x4')](_0x5e90d7){if(_0x5068('0xe')!=typeof _0x5e90d7)throw new _0x574ef8(_0x5068('0x27'));this['_dataCollectors']['add'](_0x5e90d7);}[_0x5068('0x10')](){this[_0x5068('0x1f')](_0x5068('0x11'));}[_0x5068('0x14')]({activeAnnotation:_0x3c0759,annotations:_0x32868f}){const _0x3d96c1=[],_0xd7e5ee=this[_0x5068('0x2e')]['model'][_0x5068('0x28')]['selection'],_0x217538=Array[_0x5068('0x30')](_0xd7e5ee[_0x5068('0x9')]());for(const [_0x26504f,_0x443548]of this['_editorAnnotationsData']){const _0x15ba55=_0x1f01ab(_0x443548),_0x189d1e=_0x32868f['getByInnerView'](_0x26504f);_0x15ba55&&_0x189d1e&&_0x3d96c1[_0x5068('0x29')]({'annotation':_0x189d1e,'range':_0x15ba55});}function _0x1f01ab(_0x4e4fc4){for(const _0xaa08ad of _0x4e4fc4)for(const _0x596e0d of _0x217538)if(_0xaa08ad[_0x5068('0x19')](_0x596e0d,!_0xd7e5ee['isCollapsed']))return _0xaa08ad;return null;}return _0x3d96c1[_0x5068('0x1')]((_0x33e197,_0x5da3c0)=>{const _0x3ffea0=_0x33e197[_0x5068('0xf')],_0xc8467a=_0x5da3c0[_0x5068('0xf')];if(!_0x3ffea0[_0x5068('0x16')](_0xc8467a)){if(_0x3ffea0[_0x5068('0x19')](_0xc8467a,!0x0))return 0x1;if(_0xc8467a[_0x5068('0x19')](_0x3ffea0,!0x0))return-0x1;}return _0x33e197[_0x5068('0x12')]==_0x3c0759?-0x1:_0x5da3c0[_0x5068('0x12')]==_0x3c0759?0x1:0x0;})['map'](_0x4c8eac=>_0x4c8eac['annotation']);}get[_0x5068('0x17')](){const _0x225a8d=new Map();for(const _0x396057 of Array[_0x5068('0x30')](this[_0x5068('0x7')]))for(const [_0x19ec01,_0x3df459]of _0x396057())_0x225a8d[_0x5068('0x1c')](_0x19ec01,_0x3df459);return _0x225a8d;}}
|
|
@@ -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 _0x460b=['selection','keystrokes','_addAnnotationToBalloon','remove','viewRangeToDom','InlineAnnotations','getBoundingClientRect','annotations','afterInit','_getBalloonTargetForAnnotation','fromRect','destroy','domConverter','activeAnnotation','document','push','_setSelectedAnnotations','bottom','refresh','isAttached','_selectedAnnotations','focus','getByView','top','listenTo','editing','has','mousedown','editor','set','context','target','add','_balloon','visibleView','width','getOrderedSelectedAnnotations','length','delete','hasView','every','inlineannotations-detach-not-attached','right','stopListening','switchTo','addObserver','includes','targetRect','_forceRefresh','collapse','focusTracker','update','_addedAnnotations','inlineannotations-attach-already-attached','inline','Esc','left','plugins','_removeAnnotationFromBalloon','hasActive','requires','detach','editableElement','get','blur','register','find','_manuallyClosed','setActiveAnnotation','view','isFocused','updatePosition','_closeAnnotation'];(function(_0x47b0fb,_0x460ba2){const _0x19329b=function(_0x3f7242){while(--_0x3f7242){_0x47b0fb['push'](_0x47b0fb['shift']());}};_0x19329b(++_0x460ba2);}(_0x460b,0x191));const _0x1932=function(_0x47b0fb,_0x460ba2){_0x47b0fb=_0x47b0fb-0x0;let _0x19329b=_0x460b[_0x47b0fb];return _0x19329b;};import{Plugin as _0x5f5477}from'ckeditor5/src/core';import _0x58bf6b from'./annotationsuis';import _0x51e298 from'./editorannotations';import{ContextualBalloon as _0xbea3de}from'ckeditor5/src/ui';import{MouseObserver as _0x11a2b8}from'ckeditor5/src/engine';import{CKEditorError as _0x1413c2,Rect as _0x3c79b9}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x5f5477{static get[_0x1932('0x18')](){return[_0x51e298,_0xbea3de,_0x58bf6b];}static get['pluginName'](){return _0x1932('0x2a');}constructor(_0x1fd89b){super(_0x1fd89b),_0x1fd89b[_0x1932('0x3e')][_0x1932('0x21')][_0x1932('0x9')](_0x11a2b8),this[_0x1932('0x38')]=!0x1,this[_0x1932('0x42')](_0x1932('0x32'),null),this[_0x1932('0x2c')]=null,this['_manuallyClosed']=new Set(),this['_balloon']=_0x1fd89b[_0x1932('0x15')][_0x1932('0x1b')](_0xbea3de),this['_addedAnnotations']=new Set(),this[_0x1932('0x39')]=[],this[_0x1932('0xc')]=!0x1;}['init'](){const _0x393eb8=this[_0x1932('0x41')][_0x1932('0x15')][_0x1932('0x1b')](_0x58bf6b);_0x393eb8[_0x1932('0x43')]===this[_0x1932('0x41')]&&(_0x393eb8[_0x1932('0x1d')](_0x1932('0x12'),this),this[_0x1932('0x41')][_0x1932('0x26')][_0x1932('0x42')](_0x1932('0x13'),(_0x14b9e5,_0x5ecdee)=>{const _0x229371=this[_0x1932('0x46')];if(this[_0x1932('0x38')]&&_0x229371['visibleView']){const _0x23b949=this[_0x1932('0x2c')][_0x1932('0x3b')](_0x229371[_0x1932('0x47')]);_0x23b949&&this[_0x1932('0x24')](_0x23b949),_0x5ecdee();}}));}[_0x1932('0x2d')](){const _0x1deff1=this[_0x1932('0x41')][_0x1932('0x15')][_0x1932('0x1b')](_0x58bf6b);_0x1deff1['context']===this[_0x1932('0x41')]&&(_0x1deff1[_0x1932('0x17')]()||_0x1deff1[_0x1932('0x8')](_0x1932('0x12')));}['setActiveAnnotation'](_0x27cfb8){_0x27cfb8!==this[_0x1932('0x32')]&&(this[_0x1932('0x32')]&&(this[_0x1932('0x32')]['isActive']=!0x1),_0x27cfb8&&this[_0x1932('0x41')]['ui']['focusTracker'][_0x1932('0x22')]&&(this[_0x1932('0x2c')][_0x1932('0x3f')](_0x27cfb8)&&this[_0x1932('0x27')](_0x27cfb8,!0x0),_0x27cfb8['isActive']=!0x0),_0x27cfb8||this[_0x1932('0x35')]([]),this['activeAnnotation']=_0x27cfb8);}['attach'](_0x1bbcfe){this['annotations']=_0x1bbcfe;const _0x46cf03=this[_0x1932('0x41')][_0x1932('0x15')][_0x1932('0x1b')](_0x58bf6b),_0xb0c872=this['_balloon'];if(this['isAttached'])throw new _0x1413c2(_0x1932('0x11'),this);if(_0x46cf03['context']!==this[_0x1932('0x41')])throw new _0x1413c2('inlineannotations-not-allowed-with-context',this);const _0x338d48=this[_0x1932('0x41')]['plugins'][_0x1932('0x1b')](_0x51e298);this[_0x1932('0x3d')](_0x338d48,_0x1932('0x37'),()=>{const _0xc0cf56=_0x338d48[_0x1932('0x0')]({'annotations':this[_0x1932('0x2c')],'activeAnnotation':this[_0x1932('0x32')]});var _0x492d9a,_0x995e4a;!this[_0x1932('0xc')]&&(_0x492d9a=_0xc0cf56,_0x995e4a=this[_0x1932('0x39')],_0x492d9a[_0x1932('0x1')]===_0x995e4a[_0x1932('0x1')]&&_0x492d9a[_0x1932('0x4')](_0x118edf=>_0x995e4a[_0x1932('0xa')](_0x118edf)))||(this[_0x1932('0xc')]=!0x1,this[_0x1932('0x35')](_0xc0cf56),this[_0x1932('0x20')](_0xc0cf56[0x0]||null));}),this[_0x1932('0x3d')](_0x338d48,_0x1932('0x1c'),(_0x564b33,{isAnnotationTracked:_0x2ff8f9})=>{this[_0x1932('0x32')]&&_0x2ff8f9(this[_0x1932('0x32')])&&(this[_0x1932('0x35')]([]),this[_0x1932('0x20')](null));}),this[_0x1932('0x3d')](this[_0x1932('0x41')]['ui'][_0x1932('0xe')],'change:isFocused',(_0x324814,_0x393276,_0x20d599)=>{_0x20d599||this[_0x1932('0x20')](null);}),this[_0x1932('0x3d')](_0x1bbcfe,_0x1932('0x28'),(_0x2bf089,_0x1b497d)=>{this[_0x1932('0x16')](_0x1b497d),_0x1b497d===this['activeAnnotation']&&this[_0x1932('0x20')](null);}),this[_0x1932('0x3d')](_0xb0c872,'change:visibleView',(_0xf1940f,_0x2c7877,_0x5671b3,_0x506ad5)=>{_0x506ad5&&this[_0x1932('0x7')](_0x506ad5);const _0x3f67a3=_0x1bbcfe[_0x1932('0x3b')](_0x5671b3);_0x5671b3&&_0x3f67a3&&(this['listenTo'](_0x5671b3,'change:height',()=>{_0xb0c872[_0x1932('0x23')]();}),this[_0x1932('0x3d')](_0x5671b3,_0x1932('0x13'),()=>{this[_0x1932('0x24')](_0x3f67a3),this[_0x1932('0x41')][_0x1932('0x3e')][_0x1932('0x21')][_0x1932('0x3a')]();}),this['activeAnnotation']!==_0x3f67a3&&this[_0x1932('0x20')](_0x3f67a3));}),this[_0x1932('0x3d')](this[_0x1932('0x41')]['ui'],_0x1932('0xf'),()=>{_0xb0c872[_0x1932('0x47')]&&(_0x1bbcfe[_0x1932('0x3b')](_0xb0c872[_0x1932('0x47')])&&_0xb0c872[_0x1932('0x23')]());}),this[_0x1932('0x3d')](this[_0x1932('0x41')][_0x1932('0x3e')][_0x1932('0x21')][_0x1932('0x33')],_0x1932('0x40'),()=>{this['_forceRefresh']=!0x0,this[_0x1932('0x1f')]['clear']();}),this[_0x1932('0x41')][_0x1932('0x3e')]['view'][_0x1932('0x33')]['selection'][_0x1932('0x1a')]&&this[_0x1932('0x41')]['editing'][_0x1932('0x21')][_0x1932('0x3a')](),this['isAttached']=!0x0;}[_0x1932('0x19')](){if(!this['isAttached'])throw new _0x1413c2(_0x1932('0x5'),this);this[_0x1932('0x20')](null);for(const _0xff2e51 of this['_addedAnnotations'])this[_0x1932('0x16')](_0xff2e51);this['stopListening'](),this['isAttached']=!0x1,this[_0x1932('0x2c')]=null;}[_0x1932('0x30')](){this[_0x1932('0x38')]&&this[_0x1932('0x19')]();}[_0x1932('0x35')](_0x508724){for(const _0x597b51 of this['_selectedAnnotations'])_0x508724[_0x1932('0xa')](_0x597b51)||this[_0x1932('0x1f')][_0x1932('0x2')](_0x597b51);for(const _0x5818fd of this[_0x1932('0x2c')])_0x508724[_0x1932('0xa')](_0x5818fd)||this[_0x1932('0x16')](_0x5818fd);if(this[_0x1932('0x41')]['ui'][_0x1932('0xe')][_0x1932('0x22')])for(const _0x76d6ab of _0x508724)this[_0x1932('0x27')](_0x76d6ab);this[_0x1932('0x39')]=_0x508724;}[_0x1932('0x27')](_0x212ad7,_0x500ec4=!0x1){this[_0x1932('0x1f')]['has'](_0x212ad7)||(this[_0x1932('0x10')][_0x1932('0x3f')](_0x212ad7)||this['_balloon'][_0x1932('0x3')](_0x212ad7[_0x1932('0x21')])||(this['_addedAnnotations'][_0x1932('0x45')](_0x212ad7),this['_balloon']['add']({'stackId':_0x212ad7[_0x1932('0x21')]['id'],'view':_0x212ad7[_0x1932('0x21')],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x212ad7)}})),_0x500ec4&&this[_0x1932('0x46')]['showStack'](_0x212ad7['view']['id']));}[_0x1932('0x2e')](_0xeb4113){const _0x5989ed=_0xeb4113[_0x1932('0x44')],_0x33a599=this[_0x1932('0x41')]['editing'][_0x1932('0x21')],_0x3bbe19=_0x33a599[_0x1932('0x33')][_0x1932('0x25')]['getFirstRange'](),_0x5b2617=_0x33a599[_0x1932('0x31')][_0x1932('0x29')](_0x3bbe19);if(_0x5b2617[_0x1932('0xd')](!0x0),_0x5989ed){if(_0x5989ed instanceof _0x3c79b9)return _0x5989ed;let _0x59452d=[];for(const _0x30f5a5 of _0x5989ed)_0x59452d['push'](...(_0x4d30a2=_0x30f5a5['getClientRects'](),Array['from'](_0x4d30a2)['map'](DOMRect[_0x1932('0x2f')])));_0x59452d=function(_0x54ac46){const _0x214f10=[];let _0x2f553b=_0x54ac46[0x0];for(let _0x2d9ce4=0x1;_0x2d9ce4<_0x54ac46[_0x1932('0x1')];_0x2d9ce4++)F(_0x2f553b,_0x54ac46[_0x2d9ce4])?_0x2f553b[_0x1932('0x48')]+=_0x54ac46[_0x2d9ce4][_0x1932('0x48')]:(_0x214f10[_0x1932('0x34')](_0x2f553b),_0x2f553b=_0x54ac46[_0x2d9ce4]);return _0x214f10[_0x1932('0x34')](_0x2f553b),_0x214f10;}(_0x59452d);const _0x11e42e=_0x5b2617[_0x1932('0x2b')]();return _0x59452d[_0x1932('0x1e')](_0x521b0c=>_0x521b0c['top']<=_0x11e42e[_0x1932('0x3c')]&&_0x521b0c['bottom']>=_0x11e42e[_0x1932('0x36')]&&_0x521b0c[_0x1932('0x14')]<=_0x11e42e[_0x1932('0x14')]&&_0x521b0c[_0x1932('0x6')]>=_0x11e42e[_0x1932('0x6')])||_0x59452d[0x0];}var _0x4d30a2;return _0xeb4113[_0x1932('0xb')]||_0x5b2617;}[_0x1932('0x16')](_0x33441e){this[_0x1932('0x10')]['has'](_0x33441e)&&this[_0x1932('0x46')][_0x1932('0x3')](_0x33441e[_0x1932('0x21')])&&(this[_0x1932('0x10')][_0x1932('0x2')](_0x33441e),this[_0x1932('0x46')][_0x1932('0x28')](_0x33441e[_0x1932('0x21')]));}[_0x1932('0x24')](_0x224d1e){this[_0x1932('0x1f')][_0x1932('0x45')](_0x224d1e),this[_0x1932('0x16')](_0x224d1e);}}function F(_0x4f83e8,_0x582743){return _0x4f83e8[_0x1932('0x3c')]===_0x582743[_0x1932('0x3c')]&&_0x4f83e8[_0x1932('0x36')]===_0x582743[_0x1932('0x36')]&&_0x4f83e8[_0x1932('0x6')]===_0x582743[_0x1932('0x14')];}
|
|
@@ -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
|
+
}
|