@ckeditor/ckeditor5-comments 41.3.1 → 41.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/comments.js +1 -1
- package/build/translations/ti.js +1 -0
- package/dist/index-content.css +4 -0
- package/dist/index-editor.css +596 -0
- package/dist/index.css +990 -0
- package/dist/index.js +23 -0
- package/dist/translations/af.d.ts +8 -0
- package/dist/translations/af.js +23 -0
- package/dist/translations/af.umd.js +23 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +23 -0
- package/dist/translations/ar.umd.js +23 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +23 -0
- package/dist/translations/bg.umd.js +23 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +23 -0
- package/dist/translations/bn.umd.js +23 -0
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +23 -0
- package/dist/translations/bs.umd.js +23 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +23 -0
- package/dist/translations/ca.umd.js +23 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +23 -0
- package/dist/translations/cs.umd.js +23 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +23 -0
- package/dist/translations/da.umd.js +23 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +23 -0
- package/dist/translations/de-ch.umd.js +23 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +23 -0
- package/dist/translations/de.umd.js +23 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +23 -0
- package/dist/translations/el.umd.js +23 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +23 -0
- package/dist/translations/en-au.umd.js +23 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +23 -0
- package/dist/translations/en.umd.js +23 -0
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +23 -0
- package/dist/translations/es-co.umd.js +23 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +23 -0
- package/dist/translations/es.umd.js +23 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +23 -0
- package/dist/translations/et.umd.js +23 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +23 -0
- package/dist/translations/fa.umd.js +23 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +23 -0
- package/dist/translations/fi.umd.js +23 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +23 -0
- package/dist/translations/fr.umd.js +23 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +23 -0
- package/dist/translations/gl.umd.js +23 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +23 -0
- package/dist/translations/he.umd.js +23 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +23 -0
- package/dist/translations/hi.umd.js +23 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +23 -0
- package/dist/translations/hr.umd.js +23 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +23 -0
- package/dist/translations/hu.umd.js +23 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +23 -0
- package/dist/translations/id.umd.js +23 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +23 -0
- package/dist/translations/it.umd.js +23 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +23 -0
- package/dist/translations/ja.umd.js +23 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +23 -0
- package/dist/translations/jv.umd.js +23 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +23 -0
- package/dist/translations/ko.umd.js +23 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +23 -0
- package/dist/translations/lt.umd.js +23 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +23 -0
- package/dist/translations/lv.umd.js +23 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +23 -0
- package/dist/translations/ms.umd.js +23 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +23 -0
- package/dist/translations/nl.umd.js +23 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +23 -0
- package/dist/translations/no.umd.js +23 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +23 -0
- package/dist/translations/pl.umd.js +23 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +23 -0
- package/dist/translations/pt-br.umd.js +23 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +23 -0
- package/dist/translations/pt.umd.js +23 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +23 -0
- package/dist/translations/ro.umd.js +23 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +23 -0
- package/dist/translations/ru.umd.js +23 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +23 -0
- package/dist/translations/sk.umd.js +23 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +23 -0
- package/dist/translations/sq.umd.js +23 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +23 -0
- package/dist/translations/sr-latn.umd.js +23 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +23 -0
- package/dist/translations/sr.umd.js +23 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +23 -0
- package/dist/translations/sv.umd.js +23 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +23 -0
- package/dist/translations/th.umd.js +23 -0
- package/dist/translations/ti.d.ts +8 -0
- package/dist/translations/ti.js +23 -0
- package/dist/translations/ti.umd.js +23 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +23 -0
- package/dist/translations/tk.umd.js +23 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +23 -0
- package/dist/translations/tr.umd.js +23 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +23 -0
- package/dist/translations/tt.umd.js +23 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +23 -0
- package/dist/translations/ug.umd.js +23 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +23 -0
- package/dist/translations/uk.umd.js +23 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +23 -0
- package/dist/translations/ur.umd.js +23 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +23 -0
- package/dist/translations/vi.umd.js +23 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +23 -0
- package/dist/translations/zh-cn.umd.js +23 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +23 -0
- package/dist/translations/zh.umd.js +23 -0
- package/dist/types/annotations/annotation.d.ts +94 -0
- package/dist/types/annotations/annotationcollection.d.ts +102 -0
- package/dist/types/annotations/annotations.d.ts +158 -0
- package/dist/types/annotations/annotationsuis.d.ts +236 -0
- package/dist/types/annotations/editorannotations.d.ts +71 -0
- package/dist/types/annotations/inlineannotations.d.ts +94 -0
- package/dist/types/annotations/narrowsidebar.d.ts +89 -0
- package/dist/types/annotations/sidebar.d.ts +104 -0
- package/dist/types/annotations/view/annotationcounterbuttonview.d.ts +33 -0
- package/dist/types/annotations/view/annotationview.d.ts +94 -0
- package/dist/types/annotations/view/sidebaritemview.d.ts +59 -0
- package/dist/types/annotations/view/sidebarview.d.ts +36 -0
- package/dist/types/annotations/widesidebar.d.ts +81 -0
- package/dist/types/augmentation.d.ts +56 -0
- package/dist/types/comments/addcommentthreadcommand.d.ts +39 -0
- package/dist/types/comments/commentsarchive.d.ts +35 -0
- package/dist/types/comments/commentsarchiveui.d.ts +42 -0
- package/dist/types/comments/commentsediting.d.ts +84 -0
- package/dist/types/comments/commentsrepository.d.ts +1134 -0
- package/dist/types/comments/commentsui.d.ts +37 -0
- package/dist/types/comments/integrations/clipboard.d.ts +30 -0
- package/dist/types/comments/integrations/commentsrestrictededitingmode.d.ts +21 -0
- package/dist/types/comments/integrations/importword.d.ts +25 -0
- package/dist/types/comments/ui/commenteditor/commenteditor.d.ts +40 -0
- package/dist/types/comments/ui/commenteditor/commenteditorui.d.ts +35 -0
- package/dist/types/comments/ui/commenteditor/commenteditoruiview.d.ts +40 -0
- package/dist/types/comments/ui/commentthreadcontroller.d.ts +68 -0
- package/dist/types/comments/ui/view/basecommentthreadview.d.ts +123 -0
- package/dist/types/comments/ui/view/basecommentview.d.ts +116 -0
- package/dist/types/comments/ui/view/collapsedcommentsview.d.ts +17 -0
- package/dist/types/comments/ui/view/commentcontentview.d.ts +18 -0
- package/dist/types/comments/ui/view/commentinputview.d.ts +90 -0
- package/dist/types/comments/ui/view/commentsarchiveview.d.ts +42 -0
- package/dist/types/comments/ui/view/commentslistview.d.ts +104 -0
- package/dist/types/comments/ui/view/commentthreadheaderview.d.ts +54 -0
- package/dist/types/comments/ui/view/commentthreadinputview.d.ts +45 -0
- package/dist/types/comments/ui/view/commentthreadview.d.ts +122 -0
- package/dist/types/comments/ui/view/commentview.d.ts +247 -0
- package/dist/types/comments.d.ts +39 -0
- package/dist/types/commentsonly.d.ts +37 -0
- package/dist/types/config.d.ts +202 -0
- package/dist/types/index.d.ts +28 -0
- package/dist/types/utils/common-translations.d.ts +13 -0
- package/dist/types/utils/createmutationobserver.d.ts +18 -0
- package/lang/translations/ti.po +120 -0
- package/package.json +4 -3
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.js +1 -1
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1 -1
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/clipboard.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
- package/src/comments/ui/commentthreadcontroller.js +1 -1
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.js +1 -1
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.js +1 -1
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.js +1 -1
- package/src/commentsonly.js +1 -1
- package/src/index.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.js +1 -1
- package/theme/annotation.css +13 -0
- package/theme/comment.css +4 -0
- package/theme/commentinput.css +4 -0
- package/theme/commentthread.css +8 -0
- package/theme/sidebar.css +8 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module comments/annotations/editorannotations
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import Annotations from './annotations.js';
|
|
15
|
+
import type Annotation from './annotation.js';
|
|
16
|
+
import type AnnotationCollection from './annotationcollection.js';
|
|
17
|
+
/**
|
|
18
|
+
* Integrates {@link module:comments/annotations/annotations~Annotations annotations} with the editor to provide proper behavior
|
|
19
|
+
* for annotations created through the editor features.
|
|
20
|
+
*
|
|
21
|
+
* *Note: The API of this class might change in the near future.*
|
|
22
|
+
*
|
|
23
|
+
* Collects all types of the annotations created through the editor features and their markers and decides which annotation is currently
|
|
24
|
+
* selected by the selection.
|
|
25
|
+
*
|
|
26
|
+
* Every editor plugin that adds an annotation should also
|
|
27
|
+
* {@link module:comments/annotations/editorannotations~EditorAnnotations#addSourceCollector register a callback}
|
|
28
|
+
* in which it will check whether given annotation should be marked as selected.
|
|
29
|
+
*/
|
|
30
|
+
export default class EditorAnnotations extends Plugin {
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
static get requires(): readonly [typeof Annotations];
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
static get pluginName(): "EditorAnnotations";
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
constructor(editor: Editor);
|
|
43
|
+
/**
|
|
44
|
+
* @inheritDoc
|
|
45
|
+
*/
|
|
46
|
+
init(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Registers given annotation as an editor annotation, that is an annotation that is linked with a target inside the editor content.
|
|
49
|
+
*/
|
|
50
|
+
registerAnnotation(annotation: Annotation): void;
|
|
51
|
+
hasDomSelection(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Registers a callback that collects annotations and their markers.
|
|
54
|
+
*/
|
|
55
|
+
addSourceCollector(callback: Function): void;
|
|
56
|
+
/**
|
|
57
|
+
* Finds all annotations selected by the editor selection and marks the most inner one as the active annotation.
|
|
58
|
+
*/
|
|
59
|
+
refreshSelectedViews(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Finds all annotations for selected markers in order from the most inner marker to the most outer marker.
|
|
62
|
+
*
|
|
63
|
+
* @param options.annotations The collection of annotations for given UI.
|
|
64
|
+
* @param options.activeAnnotation The given UI active annotation.
|
|
65
|
+
* It is used to determine the order if the selection contains the active annotation's marker.
|
|
66
|
+
*/
|
|
67
|
+
getOrderedSelectedAnnotations({ activeAnnotation, annotations }: {
|
|
68
|
+
activeAnnotation: Annotation | null;
|
|
69
|
+
annotations: AnnotationCollection;
|
|
70
|
+
}): Array<Annotation>;
|
|
71
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module comments/annotations/inlineannotations
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis.js';
|
|
15
|
+
import EditorAnnotations from './editorannotations.js';
|
|
16
|
+
import { ContextualBalloon } from 'ckeditor5/src/ui.js';
|
|
17
|
+
import './../../theme/annotation-inline.css';
|
|
18
|
+
import type Annotation from './annotation.js';
|
|
19
|
+
import type AnnotationCollection from './annotationcollection.js';
|
|
20
|
+
/**
|
|
21
|
+
* The popup-style UI for displaying annotations next to editor target elements.
|
|
22
|
+
*
|
|
23
|
+
* It displays {@link module:comments/annotations/annotation~Annotation annotations} in the
|
|
24
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon balloon} where the current
|
|
25
|
+
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#activeAnnotation} is the displayed one.
|
|
26
|
+
*
|
|
27
|
+
* Note: this UI type works only with {@link module:core/editor/editor~Editor the Editor} and cannot be used in integrations where
|
|
28
|
+
* there is only {@link module:core/context~Context context} without any editor.
|
|
29
|
+
*
|
|
30
|
+
* This UI is intended for narrow screens.
|
|
31
|
+
*
|
|
32
|
+
* To activate this UI use one of the following:
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'inline' );
|
|
36
|
+
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'inline', filter );
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
40
|
+
*/
|
|
41
|
+
export default class InlineAnnotations extends Plugin implements AnnotationsUI<Plugin> {
|
|
42
|
+
/**
|
|
43
|
+
* An active annotation tracked by this UI.
|
|
44
|
+
*
|
|
45
|
+
* @observable
|
|
46
|
+
*/
|
|
47
|
+
activeAnnotation: Annotation | null;
|
|
48
|
+
isAttached: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* A collection of annotations controlled by this UI.
|
|
51
|
+
*
|
|
52
|
+
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
53
|
+
*
|
|
54
|
+
* It is set to `null` if `InlineAnnotations` is not
|
|
55
|
+
* {@link module:comments/annotations/inlineannotations~InlineAnnotations#attach attached}.
|
|
56
|
+
*/
|
|
57
|
+
annotations: AnnotationCollection | null;
|
|
58
|
+
/**
|
|
59
|
+
* @inheritDoc
|
|
60
|
+
*/
|
|
61
|
+
static get requires(): readonly [typeof EditorAnnotations, typeof ContextualBalloon, typeof AnnotationsUIs];
|
|
62
|
+
/**
|
|
63
|
+
* @inheritDoc
|
|
64
|
+
*/
|
|
65
|
+
static get pluginName(): "InlineAnnotations";
|
|
66
|
+
/**
|
|
67
|
+
* @inheritDoc
|
|
68
|
+
*/
|
|
69
|
+
constructor(editor: Editor);
|
|
70
|
+
/**
|
|
71
|
+
* @inheritDoc
|
|
72
|
+
*/
|
|
73
|
+
init(): void;
|
|
74
|
+
/**
|
|
75
|
+
* @inheritDoc
|
|
76
|
+
*/
|
|
77
|
+
afterInit(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the active annotation for this UI.
|
|
80
|
+
*/
|
|
81
|
+
setActiveAnnotation(annotation: Annotation | null): void;
|
|
82
|
+
/**
|
|
83
|
+
* @inheritDoc
|
|
84
|
+
*/
|
|
85
|
+
attach(annotations: AnnotationCollection): void;
|
|
86
|
+
/**
|
|
87
|
+
* @inheritDoc
|
|
88
|
+
*/
|
|
89
|
+
detach(): void;
|
|
90
|
+
/**
|
|
91
|
+
* @inheritDoc
|
|
92
|
+
*/
|
|
93
|
+
destroy(): void;
|
|
94
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module comments/annotations/narrowsidebar
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { ContextPlugin, Context, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis.js';
|
|
15
|
+
import Sidebar from './sidebar.js';
|
|
16
|
+
import { BalloonPanelView, BodyCollection } from 'ckeditor5/src/ui.js';
|
|
17
|
+
import '../../theme/sidebar-narrow.css';
|
|
18
|
+
import type Annotation from './annotation.js';
|
|
19
|
+
import type { default as AnnotationCollection } from './annotationcollection.js';
|
|
20
|
+
/**
|
|
21
|
+
* The narrow sidebar UI for displaying annotations.
|
|
22
|
+
*
|
|
23
|
+
* Binds {@link module:comments/annotations/annotations~Annotations} plugin with
|
|
24
|
+
* {@link module:comments/annotations/sidebar~Sidebar} plugin to display annotations in the sidebar as
|
|
25
|
+
* {@link module:comments/annotations/view/annotationcounterbuttonview~AnnotationCounterButtonView small icons}.
|
|
26
|
+
*
|
|
27
|
+
* After selecting an annotation the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} with an
|
|
28
|
+
* {@link module:comments/annotations/view/annotationview~AnnotationView} appears attached to the sidebar item.
|
|
29
|
+
*
|
|
30
|
+
* This UI is intended for medium-sized viewports.
|
|
31
|
+
*
|
|
32
|
+
* To activate this UI use one of the following:
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'narrowSidebar' );
|
|
36
|
+
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'narrowSidebar', filter );
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
40
|
+
*/
|
|
41
|
+
export default class NarrowSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
|
|
42
|
+
/**
|
|
43
|
+
* An active annotation tracked by this UI.
|
|
44
|
+
*/
|
|
45
|
+
activeAnnotation: Annotation | null;
|
|
46
|
+
bodyCollection: BodyCollection;
|
|
47
|
+
balloonPanelView: BalloonPanelView;
|
|
48
|
+
isAttached: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* A collection of annotations controlled by this UI.
|
|
51
|
+
*
|
|
52
|
+
* This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
|
|
53
|
+
*
|
|
54
|
+
* It is set to `null` if `NarrowSidebar` is not {@link module:comments/annotations/narrowsidebar~NarrowSidebar#attach attached}.
|
|
55
|
+
*/
|
|
56
|
+
annotations: AnnotationCollection | null;
|
|
57
|
+
/**
|
|
58
|
+
* @inheritDoc
|
|
59
|
+
*/
|
|
60
|
+
static get requires(): readonly [typeof Sidebar, typeof AnnotationsUIs];
|
|
61
|
+
/**
|
|
62
|
+
* @inheritDoc
|
|
63
|
+
*/
|
|
64
|
+
static get pluginName(): "NarrowSidebar";
|
|
65
|
+
/**
|
|
66
|
+
* @inheritDoc
|
|
67
|
+
*/
|
|
68
|
+
constructor(context: Context | Editor);
|
|
69
|
+
/**
|
|
70
|
+
* @inheritDoc
|
|
71
|
+
*/
|
|
72
|
+
init(): void;
|
|
73
|
+
/**
|
|
74
|
+
* @inheritDoc
|
|
75
|
+
*/
|
|
76
|
+
attach(annotations: AnnotationCollection): void;
|
|
77
|
+
/**
|
|
78
|
+
* Sets the active annotation for this UI.
|
|
79
|
+
*/
|
|
80
|
+
setActiveAnnotation(annotation: Annotation | null): void;
|
|
81
|
+
/**
|
|
82
|
+
* @inheritDoc
|
|
83
|
+
*/
|
|
84
|
+
detach(): void;
|
|
85
|
+
/**
|
|
86
|
+
* @inheritDoc
|
|
87
|
+
*/
|
|
88
|
+
destroy(): void;
|
|
89
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module comments/annotations/sidebar
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import type { View } from 'ckeditor5/src/ui.js';
|
|
15
|
+
import SidebarView from './view/sidebarview.js';
|
|
16
|
+
import SidebarItemView from './view/sidebaritemview.js';
|
|
17
|
+
import type Annotation from './annotation.js';
|
|
18
|
+
/**
|
|
19
|
+
* Displays {@link module:comments/annotations/annotationcollection~AnnotationCollection annotations} inside a sidebar.
|
|
20
|
+
*
|
|
21
|
+
* `Sidebar` provides a {@link module:comments/annotations/view/sidebarview~SidebarView} which can be injected at any place on a website.
|
|
22
|
+
*
|
|
23
|
+
* It's main role is to display and correctly position annotation views added to the sidebar, accordingly to their target elements
|
|
24
|
+
* or `Rect`s.
|
|
25
|
+
*
|
|
26
|
+
* The following plugins use `Sidebar` to provide annotations UI:
|
|
27
|
+
*
|
|
28
|
+
* * {@link module:comments/annotations/widesidebar~WideSidebar}
|
|
29
|
+
* * {@link module:comments/annotations/narrowsidebar~NarrowSidebar}
|
|
30
|
+
*
|
|
31
|
+
* The sidebar plugin introduces {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} which is a wrapper view for
|
|
32
|
+
* {@link module:comments/annotations/view/annotationview~AnnotationView}. It adds an interface needed for positioning views inside
|
|
33
|
+
* the sidebar.
|
|
34
|
+
*
|
|
35
|
+
* Structure of items:
|
|
36
|
+
*
|
|
37
|
+
* |-> SidebarItemView -> AnnotationView -> added View
|
|
38
|
+
* Sidebar#view#list -|-> SidebarItemView -> AnnotationView -> added View
|
|
39
|
+
* |-> ...
|
|
40
|
+
*/
|
|
41
|
+
export default class Sidebar extends ContextPlugin {
|
|
42
|
+
/**
|
|
43
|
+
* Container element into which sidebar is injected (in the DOM).
|
|
44
|
+
*
|
|
45
|
+
* @observable
|
|
46
|
+
*/
|
|
47
|
+
container: HTMLElement | null;
|
|
48
|
+
/**
|
|
49
|
+
* Sidebar view.
|
|
50
|
+
*/
|
|
51
|
+
view: SidebarView;
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
static get pluginName(): "Sidebar";
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
constructor(context: Context | Editor);
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
init(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Sets a new sidebar container.
|
|
66
|
+
*/
|
|
67
|
+
setContainer(container: HTMLElement): void;
|
|
68
|
+
/**
|
|
69
|
+
* Rearranges annotations when the annotation is removed.
|
|
70
|
+
*/
|
|
71
|
+
rearrange({ removedAnnotation, previousAnnotation, nextAnnotation }: {
|
|
72
|
+
removedAnnotation: Annotation;
|
|
73
|
+
previousAnnotation: Annotation | null;
|
|
74
|
+
nextAnnotation: Annotation | null;
|
|
75
|
+
}): void;
|
|
76
|
+
/**
|
|
77
|
+
* Refreshes sidebar items when one of the annotations is activated.
|
|
78
|
+
*
|
|
79
|
+
* @param options.activatedAnnotation The activated annotation.
|
|
80
|
+
* @param options.blurredAnnotation The previously active annotation.
|
|
81
|
+
* @param options.disableAnimationOnActivatedAnnotation Disables animation on the activated annotation.
|
|
82
|
+
*/
|
|
83
|
+
refresh({ blurredAnnotation, activatedAnnotation, disableAnimationOnActivatedAnnotation }: {
|
|
84
|
+
blurredAnnotation: Annotation | null;
|
|
85
|
+
activatedAnnotation: Annotation | null;
|
|
86
|
+
disableAnimationOnActivatedAnnotation?: boolean;
|
|
87
|
+
}): void;
|
|
88
|
+
/**
|
|
89
|
+
* Creates new {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} and binds its
|
|
90
|
+
* position with {@link module:comments/annotations/view/annotationview~AnnotationView} target position.
|
|
91
|
+
*
|
|
92
|
+
* By default, annotation's view will be displayed in the sidebar. However, you can provide any other view
|
|
93
|
+
* to be displayed instead using `annotationToDisplay`. `annotation` will be then used only to gather data needed by `Sidebar`.
|
|
94
|
+
*/
|
|
95
|
+
addAnnotation(annotation: Annotation, viewToDisplay?: View): SidebarItemView;
|
|
96
|
+
/**
|
|
97
|
+
* Returns sidebar item view that wraps given annotation view.
|
|
98
|
+
*/
|
|
99
|
+
getSidebarItemView(annotation: Annotation): SidebarItemView | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* @inheritDoc
|
|
102
|
+
*/
|
|
103
|
+
destroy(): void;
|
|
104
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module comments/annotations/view/annotationcounterbuttonview
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { ButtonView, View } from 'ckeditor5/src/ui.js';
|
|
14
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
15
|
+
/**
|
|
16
|
+
* A view used in the sidebar by {@link module:comments/annotations/narrowsidebar~NarrowSidebar}.
|
|
17
|
+
*/
|
|
18
|
+
export default class AnnotationCounterButtonView extends ButtonView {
|
|
19
|
+
/**
|
|
20
|
+
* @observable
|
|
21
|
+
*/
|
|
22
|
+
isDirty: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @observable
|
|
25
|
+
*/
|
|
26
|
+
number: number;
|
|
27
|
+
/**
|
|
28
|
+
* @observable
|
|
29
|
+
*/
|
|
30
|
+
annotationType: string;
|
|
31
|
+
counterView: View;
|
|
32
|
+
constructor(locale: Locale);
|
|
33
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module comments/annotations/view/annotationview
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
|
|
14
|
+
import { FocusTracker, KeystrokeHandler, type Rect, type Locale } from 'ckeditor5/src/utils.js';
|
|
15
|
+
import '../../../theme/annotation.css';
|
|
16
|
+
/**
|
|
17
|
+
* A wrapping view for any view added to the `Annotations` plugin.
|
|
18
|
+
*
|
|
19
|
+
* It introduces functionalities that make the given view ready to be used as an annotation, such as focus tracking, height resizing,
|
|
20
|
+
* and other observable properties that help share current annotation state across different UIs.
|
|
21
|
+
*/
|
|
22
|
+
export default class AnnotationView extends View {
|
|
23
|
+
/**
|
|
24
|
+
* Tracks focus on the annotation view.
|
|
25
|
+
*
|
|
26
|
+
* Add a DOM element to this focus tracker to prevent blurring annotation view
|
|
27
|
+
* when the DOM element is focused.
|
|
28
|
+
*/
|
|
29
|
+
readonly focusTracker: FocusTracker;
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly keystrokes: KeystrokeHandler;
|
|
32
|
+
/**
|
|
33
|
+
* Target rectangle to which the annotation should be attached.
|
|
34
|
+
*
|
|
35
|
+
* @observable
|
|
36
|
+
*/
|
|
37
|
+
targetRect: Rect | null;
|
|
38
|
+
/**
|
|
39
|
+
* Annotation view height.
|
|
40
|
+
*
|
|
41
|
+
* @observable
|
|
42
|
+
*/
|
|
43
|
+
height: number;
|
|
44
|
+
/**
|
|
45
|
+
* Informs if an annotation is active.
|
|
46
|
+
*
|
|
47
|
+
* @observable
|
|
48
|
+
*/
|
|
49
|
+
isActive: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Informs if there are unsaved changes in the annotation.
|
|
52
|
+
*
|
|
53
|
+
* @observable
|
|
54
|
+
*/
|
|
55
|
+
isDirty: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The number of items in the annotation.
|
|
58
|
+
*
|
|
59
|
+
* @observable
|
|
60
|
+
*/
|
|
61
|
+
length: number;
|
|
62
|
+
/**
|
|
63
|
+
* @observable
|
|
64
|
+
*/
|
|
65
|
+
type: string;
|
|
66
|
+
element: HTMLElement;
|
|
67
|
+
/**
|
|
68
|
+
* Collection for content views.
|
|
69
|
+
*/
|
|
70
|
+
content: ViewCollection;
|
|
71
|
+
/**
|
|
72
|
+
* The inner annotation view.
|
|
73
|
+
*/
|
|
74
|
+
mainView: AnnotationMainView;
|
|
75
|
+
/**
|
|
76
|
+
* @inheritDoc
|
|
77
|
+
*/
|
|
78
|
+
constructor(locale: Locale, mainView: AnnotationMainView);
|
|
79
|
+
/**
|
|
80
|
+
* @inheritDoc
|
|
81
|
+
*/
|
|
82
|
+
render(): void;
|
|
83
|
+
/**
|
|
84
|
+
* @inheritDoc
|
|
85
|
+
*/
|
|
86
|
+
destroy(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Focuses the annotation view.
|
|
89
|
+
*/
|
|
90
|
+
focus(): void;
|
|
91
|
+
}
|
|
92
|
+
export interface AnnotationMainView extends View {
|
|
93
|
+
isActive: boolean;
|
|
94
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module comments/annotations/view/sidebaritemview
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
|
|
14
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
15
|
+
/**
|
|
16
|
+
* A wrapper view that wraps given {@link module:ui/view~View} to display it as a {@link module:comments/annotations/sidebar~Sidebar} item.
|
|
17
|
+
*/
|
|
18
|
+
export default class SidebarItemView extends View {
|
|
19
|
+
element: HTMLElement;
|
|
20
|
+
/**
|
|
21
|
+
* The item top offset.
|
|
22
|
+
* Setting `0` as the initial value makes new items falling from heaven.
|
|
23
|
+
*
|
|
24
|
+
* @observable
|
|
25
|
+
*/
|
|
26
|
+
top: number;
|
|
27
|
+
/**
|
|
28
|
+
* @observable
|
|
29
|
+
*/
|
|
30
|
+
bottom: number;
|
|
31
|
+
/**
|
|
32
|
+
* @observable
|
|
33
|
+
*/
|
|
34
|
+
height: number;
|
|
35
|
+
/**
|
|
36
|
+
* @observable
|
|
37
|
+
*/
|
|
38
|
+
isAnimationDisabled: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* A collection of content views.
|
|
41
|
+
*/
|
|
42
|
+
content: ViewCollection;
|
|
43
|
+
/**
|
|
44
|
+
* @inheritDoc
|
|
45
|
+
*/
|
|
46
|
+
constructor(locale: Locale);
|
|
47
|
+
/**
|
|
48
|
+
* @inheritDoc
|
|
49
|
+
*/
|
|
50
|
+
render(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Updates {@link #height the height property} according to the element's DOM height.
|
|
53
|
+
*/
|
|
54
|
+
updateHeight(): void;
|
|
55
|
+
/**
|
|
56
|
+
* @inheritDoc
|
|
57
|
+
*/
|
|
58
|
+
destroy(): void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module comments/annotations/view/sidebarview
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
|
|
14
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
15
|
+
import '../../../theme/sidebar.css';
|
|
16
|
+
/**
|
|
17
|
+
* The sidebar view class that displays the collection of sidebar item views.
|
|
18
|
+
*/
|
|
19
|
+
export default class SidebarView extends View {
|
|
20
|
+
/**
|
|
21
|
+
* @observable
|
|
22
|
+
*/
|
|
23
|
+
minHeight: number | null;
|
|
24
|
+
/**
|
|
25
|
+
* @observable
|
|
26
|
+
*/
|
|
27
|
+
class: string;
|
|
28
|
+
/**
|
|
29
|
+
* A collection of sidebar item views.
|
|
30
|
+
*/
|
|
31
|
+
list: ViewCollection;
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
constructor(locale: Locale);
|
|
36
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module comments/annotations/widesidebar
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { ContextPlugin, Context, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis.js';
|
|
15
|
+
import Sidebar from './sidebar.js';
|
|
16
|
+
import type Annotation from './annotation.js';
|
|
17
|
+
import type { default as AnnotationCollection } from './annotationcollection.js';
|
|
18
|
+
/**
|
|
19
|
+
* The wide sidebar UI for displaying annotations.
|
|
20
|
+
*
|
|
21
|
+
* In this implementation {@link module:comments/annotations/sidebar~Sidebar the sidebar} displays full
|
|
22
|
+
* {@link module:comments/annotations/view/annotationview~AnnotationView annotation views}.
|
|
23
|
+
*
|
|
24
|
+
* To activate this UI use one of the following:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'wideSidebar' );
|
|
28
|
+
* editor.plugins.get( 'AnnotationsUIs' ).activate( 'wideSidebar', filter );
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
|
|
32
|
+
*/
|
|
33
|
+
export default class WideSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
|
|
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 `WideSidebar` is not {@link module:comments/annotations/widesidebar~WideSidebar#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(): "WideSidebar";
|
|
57
|
+
/**
|
|
58
|
+
* @inheritDoc
|
|
59
|
+
*/
|
|
60
|
+
constructor(context: Context | Editor);
|
|
61
|
+
/**
|
|
62
|
+
* @inheritDoc
|
|
63
|
+
*/
|
|
64
|
+
init(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Sets the active annotation for this UI.
|
|
67
|
+
*/
|
|
68
|
+
setActiveAnnotation(annotation: Annotation | null): void;
|
|
69
|
+
/**
|
|
70
|
+
* @inheritDoc
|
|
71
|
+
*/
|
|
72
|
+
attach(annotations: AnnotationCollection): void;
|
|
73
|
+
/**
|
|
74
|
+
* @inheritDoc
|
|
75
|
+
*/
|
|
76
|
+
detach(): void;
|
|
77
|
+
/**
|
|
78
|
+
* @inheritDoc
|
|
79
|
+
*/
|
|
80
|
+
destroy(): void;
|
|
81
|
+
}
|