@ckeditor/ckeditor5-comments 39.0.1 → 40.0.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 +2 -2
- package/LICENSE.md +6 -6
- package/README.md +14 -14
- package/build/comments.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/lang/translations/af.po +1 -0
- package/lang/translations/ar.po +1 -0
- package/lang/translations/bg.po +1 -0
- package/lang/translations/bn.po +1 -0
- package/lang/translations/bs.po +1 -0
- package/lang/translations/ca.po +1 -0
- package/lang/translations/cs.po +1 -0
- package/lang/translations/da.po +1 -0
- package/lang/translations/de-ch.po +1 -0
- package/lang/translations/de.po +1 -0
- package/lang/translations/el.po +1 -0
- package/lang/translations/en-au.po +1 -0
- package/lang/translations/en.po +1 -0
- package/lang/translations/es-co.po +1 -0
- package/lang/translations/es.po +1 -0
- package/lang/translations/et.po +1 -0
- package/lang/translations/fa.po +10 -9
- package/lang/translations/fi.po +1 -0
- package/lang/translations/fr.po +1 -0
- package/lang/translations/gl.po +1 -0
- package/lang/translations/he.po +1 -0
- package/lang/translations/hi.po +1 -0
- package/lang/translations/hr.po +1 -0
- package/lang/translations/hu.po +1 -0
- package/lang/translations/id.po +1 -0
- package/lang/translations/it.po +1 -0
- package/lang/translations/ja.po +1 -0
- package/lang/translations/jv.po +1 -0
- package/lang/translations/ko.po +1 -0
- package/lang/translations/lt.po +1 -0
- package/lang/translations/lv.po +1 -0
- package/lang/translations/ms.po +1 -0
- package/lang/translations/nl.po +1 -0
- package/lang/translations/no.po +1 -0
- package/lang/translations/pl.po +1 -0
- package/lang/translations/pt-br.po +4 -3
- package/lang/translations/pt.po +1 -0
- package/lang/translations/ro.po +1 -0
- package/lang/translations/ru.po +1 -0
- package/lang/translations/sk.po +1 -0
- package/lang/translations/sq.po +1 -0
- package/lang/translations/sr-latn.po +1 -0
- package/lang/translations/sr.po +1 -0
- package/lang/translations/sv.po +1 -0
- package/lang/translations/th.po +1 -0
- package/lang/translations/tk.po +1 -0
- package/lang/translations/tr.po +1 -0
- package/lang/translations/tt.po +1 -0
- package/lang/translations/ug.po +1 -0
- package/lang/translations/uk.po +1 -0
- package/lang/translations/ur.po +1 -0
- package/lang/translations/vi.po +1 -0
- package/lang/translations/zh-cn.po +1 -0
- package/lang/translations/zh.po +1 -0
- package/package.json +3 -7
- 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 -1105
- 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 -112
- 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 -117
- 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/annotation-inline.css +2 -1
- package/theme/annotation.css +2 -3
- package/theme/comment.css +39 -38
- package/theme/commentinput.css +2 -1
- package/theme/commentmarker.css +7 -6
- package/theme/commentsarchive.css +2 -1
- package/theme/commentthread.css +68 -57
- package/theme/icons/add-comment.svg +1 -1
- package/theme/icons/comments-archive.svg +1 -1
- package/theme/icons/edit-comment.svg +1 -1
- package/theme/icons/remove-comment.svg +1 -1
- package/theme/sidebar-narrow.css +4 -3
- package/theme/sidebar.css +13 -12
|
@@ -1,154 +1,154 @@
|
|
|
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/annotations
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
|
|
10
|
-
import type { View } from 'ckeditor5/src/ui';
|
|
11
|
-
import { type Locale } from 'ckeditor5/src/utils';
|
|
12
|
-
import Annotation, { type AnnotationTarget } from './annotation';
|
|
13
|
-
import AnnotationCollection from './annotationcollection';
|
|
14
|
-
import AnnotationView, { type AnnotationMainView } from './view/annotationview';
|
|
15
|
-
/**
|
|
16
|
-
* Stores and manages all {@link module:comments/annotations/annotation~Annotation annotations} created
|
|
17
|
-
* for the entire {@link module:core/context~Context} or {@link module:core/editor/editor~Editor}.
|
|
18
|
-
*
|
|
19
|
-
* It allows for {@link module:comments/annotations/annotations~Annotations#add adding} and
|
|
20
|
-
* {@link module:comments/annotations/annotations~Annotations#remove removing} annotations.
|
|
21
|
-
*
|
|
22
|
-
* It manages {@link module:comments/annotations/annotations~Annotations#activate activating} and
|
|
23
|
-
* {@link module:comments/annotations/annotations~Annotations#deactivateAll deactivating} annotations. Using those methods will
|
|
24
|
-
* result in setting {@link module:comments/annotations/annotationsuis~AnnotationUI#activeAnnotation} in the appropriate
|
|
25
|
-
* {@link module:comments/annotations/annotationsuis~AnnotationsUI annotations UI} plugins.
|
|
26
|
-
*
|
|
27
|
-
* All active annotations are stored in {@link module:comments/annotations/annotations~Annotations#activeAnnotations}.
|
|
28
|
-
*
|
|
29
|
-
* `Annotations` is linked with {@link module:comments/annotations/annotationsuis~AnnotationsUIs}, which listens to events fired by
|
|
30
|
-
* `Annotations` and propagates information to and from annotations UI plugins.
|
|
31
|
-
*/
|
|
32
|
-
export default class Annotations extends ContextPlugin {
|
|
33
|
-
/**
|
|
34
|
-
* A set of currently active annotations.
|
|
35
|
-
*
|
|
36
|
-
* @observable
|
|
37
|
-
*/
|
|
38
|
-
activeAnnotations: Set<Annotation>;
|
|
39
|
-
/**
|
|
40
|
-
* A collection of all annotations. It should not be operated on directly.
|
|
41
|
-
*/
|
|
42
|
-
readonly collection: AnnotationCollection;
|
|
43
|
-
/**
|
|
44
|
-
* @inheritDoc
|
|
45
|
-
*/
|
|
46
|
-
static get pluginName(): "Annotations";
|
|
47
|
-
/**
|
|
48
|
-
* @inheritDoc
|
|
49
|
-
*/
|
|
50
|
-
constructor(context: Context | Editor);
|
|
51
|
-
/**
|
|
52
|
-
* Adds an annotation to the collection.
|
|
53
|
-
*/
|
|
54
|
-
add(annotation: Annotation): void;
|
|
55
|
-
/**
|
|
56
|
-
* Removes the given annotation from the collection.
|
|
57
|
-
*/
|
|
58
|
-
remove(annotation: Annotation): void;
|
|
59
|
-
/**
|
|
60
|
-
* Refreshes the visibility of annotations based on the visibility of their annotation targets.
|
|
61
|
-
*
|
|
62
|
-
* This method should be called when one or more annotations' targets changed their visibility,
|
|
63
|
-
* for example when one of the editors was shown or hidden.
|
|
64
|
-
*
|
|
65
|
-
* This method recalculates all annotations' {@link module:comments/annotations/annotation~Annotation#isVisible `isVisible`} property.
|
|
66
|
-
*/
|
|
67
|
-
refreshVisibility(): void;
|
|
68
|
-
/**
|
|
69
|
-
* Refreshes the positioning of all visible annotations and sorts them topmost and leftmost.
|
|
70
|
-
*/
|
|
71
|
-
refreshPositioning(): void;
|
|
72
|
-
/**
|
|
73
|
-
* Returns the annotation that "contains" the given annotation view's inner view.
|
|
74
|
-
*/
|
|
75
|
-
getByInnerView(innerView: View): Annotation | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Deactivates all active annotations.
|
|
78
|
-
*
|
|
79
|
-
* @fires _deactivateAllAnnotations
|
|
80
|
-
*/
|
|
81
|
-
deactivateAll(): void;
|
|
82
|
-
/**
|
|
83
|
-
* @inheritDoc
|
|
84
|
-
*/
|
|
85
|
-
destroy(): void;
|
|
86
|
-
/**
|
|
87
|
-
* Activates the given annotation.
|
|
88
|
-
*
|
|
89
|
-
* If annotations UI that handles the given annotation already has an active annotation,
|
|
90
|
-
* then it deactivates it and activates the provided one.
|
|
91
|
-
*
|
|
92
|
-
* @fires _activateAnnotation
|
|
93
|
-
*/
|
|
94
|
-
activate(annotation: Annotation): void;
|
|
95
|
-
/**
|
|
96
|
-
* Creates an annotation.
|
|
97
|
-
*
|
|
98
|
-
* ```ts
|
|
99
|
-
* const annotationView = annotations.createAnnotationView( editor.locale, innerView );
|
|
100
|
-
*
|
|
101
|
-
* const annotation = annotations.createAnnotation( {
|
|
102
|
-
* view: annotationView,
|
|
103
|
-
* target: document.getElementById( 'target' ),
|
|
104
|
-
* type: 'comment'
|
|
105
|
-
* } );
|
|
106
|
-
* ```
|
|
107
|
-
*
|
|
108
|
-
* @returns An annotation.
|
|
109
|
-
*/
|
|
110
|
-
createAnnotation(options: AnnotationOptions): Annotation;
|
|
111
|
-
/**
|
|
112
|
-
* Creates an annotation view wrapper for the annotation content.
|
|
113
|
-
*
|
|
114
|
-
* ```ts
|
|
115
|
-
* const innerView = createCustomView();
|
|
116
|
-
* const annotationView = annotations.createAnnotationView( editor.locale, innerView );
|
|
117
|
-
* ```
|
|
118
|
-
*
|
|
119
|
-
* @returns An annotation view.
|
|
120
|
-
*/
|
|
121
|
-
createAnnotationView(locale: Locale, view: AnnotationMainView): AnnotationView;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* The configuration options which are used to create new {@link module:comments/annotations/annotation~Annotation annotations}.
|
|
125
|
-
*
|
|
126
|
-
* @param view The annotation view.
|
|
127
|
-
* @param target The annotation target.
|
|
128
|
-
* @param type The annotation type.
|
|
129
|
-
* @param isVisible The initial visibility of the annotation.
|
|
130
|
-
*/
|
|
131
|
-
export interface AnnotationOptions {
|
|
132
|
-
view: AnnotationView;
|
|
133
|
-
target: AnnotationTarget;
|
|
134
|
-
type: string | (() => string);
|
|
135
|
-
isVisible?: boolean;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* An internal event that fires when the annotation should be activated.
|
|
139
|
-
*
|
|
140
|
-
* @eventName ~Annotations#_activateAnnotation
|
|
141
|
-
*/
|
|
142
|
-
export type ActivateAnnotationEvent = {
|
|
143
|
-
name: '_activateAnnotation';
|
|
144
|
-
args: [annotation: Annotation];
|
|
145
|
-
};
|
|
146
|
-
/**
|
|
147
|
-
* An internal event that fires when all annotations should be deactivated.
|
|
148
|
-
*
|
|
149
|
-
* @eventName ~Annotations#_deactivateAllAnnotations
|
|
150
|
-
*/
|
|
151
|
-
export type DeactivateAllAnnotationsEvent = {
|
|
152
|
-
name: '_deactivateAllAnnotations';
|
|
153
|
-
args: [];
|
|
154
|
-
};
|
|
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/annotations
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
|
|
10
|
+
import type { View } from 'ckeditor5/src/ui';
|
|
11
|
+
import { type Locale } from 'ckeditor5/src/utils';
|
|
12
|
+
import Annotation, { type AnnotationTarget } from './annotation';
|
|
13
|
+
import AnnotationCollection from './annotationcollection';
|
|
14
|
+
import AnnotationView, { type AnnotationMainView } from './view/annotationview';
|
|
15
|
+
/**
|
|
16
|
+
* Stores and manages all {@link module:comments/annotations/annotation~Annotation annotations} created
|
|
17
|
+
* for the entire {@link module:core/context~Context} or {@link module:core/editor/editor~Editor}.
|
|
18
|
+
*
|
|
19
|
+
* It allows for {@link module:comments/annotations/annotations~Annotations#add adding} and
|
|
20
|
+
* {@link module:comments/annotations/annotations~Annotations#remove removing} annotations.
|
|
21
|
+
*
|
|
22
|
+
* It manages {@link module:comments/annotations/annotations~Annotations#activate activating} and
|
|
23
|
+
* {@link module:comments/annotations/annotations~Annotations#deactivateAll deactivating} annotations. Using those methods will
|
|
24
|
+
* result in setting {@link module:comments/annotations/annotationsuis~AnnotationUI#activeAnnotation} in the appropriate
|
|
25
|
+
* {@link module:comments/annotations/annotationsuis~AnnotationsUI annotations UI} plugins.
|
|
26
|
+
*
|
|
27
|
+
* All active annotations are stored in {@link module:comments/annotations/annotations~Annotations#activeAnnotations}.
|
|
28
|
+
*
|
|
29
|
+
* `Annotations` is linked with {@link module:comments/annotations/annotationsuis~AnnotationsUIs}, which listens to events fired by
|
|
30
|
+
* `Annotations` and propagates information to and from annotations UI plugins.
|
|
31
|
+
*/
|
|
32
|
+
export default class Annotations extends ContextPlugin {
|
|
33
|
+
/**
|
|
34
|
+
* A set of currently active annotations.
|
|
35
|
+
*
|
|
36
|
+
* @observable
|
|
37
|
+
*/
|
|
38
|
+
activeAnnotations: Set<Annotation>;
|
|
39
|
+
/**
|
|
40
|
+
* A collection of all annotations. It should not be operated on directly.
|
|
41
|
+
*/
|
|
42
|
+
readonly collection: AnnotationCollection;
|
|
43
|
+
/**
|
|
44
|
+
* @inheritDoc
|
|
45
|
+
*/
|
|
46
|
+
static get pluginName(): "Annotations";
|
|
47
|
+
/**
|
|
48
|
+
* @inheritDoc
|
|
49
|
+
*/
|
|
50
|
+
constructor(context: Context | Editor);
|
|
51
|
+
/**
|
|
52
|
+
* Adds an annotation to the collection.
|
|
53
|
+
*/
|
|
54
|
+
add(annotation: Annotation): void;
|
|
55
|
+
/**
|
|
56
|
+
* Removes the given annotation from the collection.
|
|
57
|
+
*/
|
|
58
|
+
remove(annotation: Annotation): void;
|
|
59
|
+
/**
|
|
60
|
+
* Refreshes the visibility of annotations based on the visibility of their annotation targets.
|
|
61
|
+
*
|
|
62
|
+
* This method should be called when one or more annotations' targets changed their visibility,
|
|
63
|
+
* for example when one of the editors was shown or hidden.
|
|
64
|
+
*
|
|
65
|
+
* This method recalculates all annotations' {@link module:comments/annotations/annotation~Annotation#isVisible `isVisible`} property.
|
|
66
|
+
*/
|
|
67
|
+
refreshVisibility(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Refreshes the positioning of all visible annotations and sorts them topmost and leftmost.
|
|
70
|
+
*/
|
|
71
|
+
refreshPositioning(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the annotation that "contains" the given annotation view's inner view.
|
|
74
|
+
*/
|
|
75
|
+
getByInnerView(innerView: View): Annotation | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Deactivates all active annotations.
|
|
78
|
+
*
|
|
79
|
+
* @fires _deactivateAllAnnotations
|
|
80
|
+
*/
|
|
81
|
+
deactivateAll(): void;
|
|
82
|
+
/**
|
|
83
|
+
* @inheritDoc
|
|
84
|
+
*/
|
|
85
|
+
destroy(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Activates the given annotation.
|
|
88
|
+
*
|
|
89
|
+
* If annotations UI that handles the given annotation already has an active annotation,
|
|
90
|
+
* then it deactivates it and activates the provided one.
|
|
91
|
+
*
|
|
92
|
+
* @fires _activateAnnotation
|
|
93
|
+
*/
|
|
94
|
+
activate(annotation: Annotation): void;
|
|
95
|
+
/**
|
|
96
|
+
* Creates an annotation.
|
|
97
|
+
*
|
|
98
|
+
* ```ts
|
|
99
|
+
* const annotationView = annotations.createAnnotationView( editor.locale, innerView );
|
|
100
|
+
*
|
|
101
|
+
* const annotation = annotations.createAnnotation( {
|
|
102
|
+
* view: annotationView,
|
|
103
|
+
* target: document.getElementById( 'target' ),
|
|
104
|
+
* type: 'comment'
|
|
105
|
+
* } );
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @returns An annotation.
|
|
109
|
+
*/
|
|
110
|
+
createAnnotation(options: AnnotationOptions): Annotation;
|
|
111
|
+
/**
|
|
112
|
+
* Creates an annotation view wrapper for the annotation content.
|
|
113
|
+
*
|
|
114
|
+
* ```ts
|
|
115
|
+
* const innerView = createCustomView();
|
|
116
|
+
* const annotationView = annotations.createAnnotationView( editor.locale, innerView );
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @returns An annotation view.
|
|
120
|
+
*/
|
|
121
|
+
createAnnotationView(locale: Locale, view: AnnotationMainView): AnnotationView;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The configuration options which are used to create new {@link module:comments/annotations/annotation~Annotation annotations}.
|
|
125
|
+
*
|
|
126
|
+
* @param view The annotation view.
|
|
127
|
+
* @param target The annotation target.
|
|
128
|
+
* @param type The annotation type.
|
|
129
|
+
* @param isVisible The initial visibility of the annotation.
|
|
130
|
+
*/
|
|
131
|
+
export interface AnnotationOptions {
|
|
132
|
+
view: AnnotationView;
|
|
133
|
+
target: AnnotationTarget;
|
|
134
|
+
type: string | (() => string);
|
|
135
|
+
isVisible?: boolean;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* An internal event that fires when the annotation should be activated.
|
|
139
|
+
*
|
|
140
|
+
* @eventName ~Annotations#_activateAnnotation
|
|
141
|
+
*/
|
|
142
|
+
export type ActivateAnnotationEvent = {
|
|
143
|
+
name: '_activateAnnotation';
|
|
144
|
+
args: [annotation: Annotation];
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* An internal event that fires when all annotations should be deactivated.
|
|
148
|
+
*
|
|
149
|
+
* @eventName ~Annotations#_deactivateAllAnnotations
|
|
150
|
+
*/
|
|
151
|
+
export type DeactivateAllAnnotationsEvent = {
|
|
152
|
+
name: '_deactivateAllAnnotations';
|
|
153
|
+
args: [];
|
|
154
|
+
};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2741=['view','remove','refreshVisibility','pluginName','getByInnerView','element','Annotations','focusTracker','set','stopListening','collection','change:isVisible','refreshPositioning','activeAnnotations','isVisible','createAnnotationView','_deactivateAllAnnotations','deactivateAll','_visibleAnnotations','has','createAnnotation','_activateAnnotation','destroy','add','delete','_removeActiveAnnotation','activate'];(function(_0x575018,_0x2741b8){const _0x558989=function(_0x4236f4){while(--_0x4236f4){_0x575018['push'](_0x575018['shift']());}};_0x558989(++_0x2741b8);}(_0x2741,0x1d3));const _0x5589=function(_0x575018,_0x2741b8){_0x575018=_0x575018-0x0;let _0x558989=_0x2741[_0x575018];return _0x558989;};import{ContextPlugin as _0x36b842}from'ckeditor5/src/core';import _0x27df80 from'./annotation';import _0x4c6d8a from'./annotationcollection';import _0x49014c from'./view/annotationview';export default class b extends _0x36b842{static get[_0x5589('0x16')](){return _0x5589('0x19');}constructor(_0x5d7fe1){super(_0x5d7fe1),this[_0x5589('0x2')]=new _0x4c6d8a(),this['_visibleAnnotations']=new _0x4c6d8a(),this[_0x5589('0x0')](_0x5589('0x5'),new Set()),this['_bindAnnotationsToVisibleAnnotations']();}[_0x5589('0xf')](_0x3ac2ea){this[_0x5589('0x2')]['add'](_0x3ac2ea);}['remove'](_0x1fd251){this['collection']['remove'](_0x1fd251),_0x1fd251['destroy']();}[_0x5589('0x15')](){for(const _0x400b3d of this['collection'])_0x400b3d[_0x5589('0x15')]();}[_0x5589('0x4')](){this[_0x5589('0xa')]['refreshPositioning']();}[_0x5589('0x17')](_0x30c02a){return this[_0x5589('0x2')][_0x5589('0x17')](_0x30c02a);}[_0x5589('0x9')](){this['fire'](_0x5589('0x8'));}[_0x5589('0xe')](){for(const _0x8d05fe of this[_0x5589('0x2')])_0x8d05fe[_0x5589('0xe')]();this['_visibleAnnotations'][_0x5589('0xe')](),this[_0x5589('0x2')][_0x5589('0xe')](),super[_0x5589('0xe')]();}[_0x5589('0x12')](_0x119214){this['fire'](_0x5589('0xd'),_0x119214);}[_0x5589('0xc')](_0x58213b){return new _0x27df80(_0x58213b);}[_0x5589('0x7')](_0x2f3e05,_0x37443e){return new _0x49014c(_0x2f3e05,_0x37443e);}['_addActiveAnnotation'](_0x13be01){const _0x1cc4f0=new Set(this['activeAnnotations']);_0x1cc4f0[_0x5589('0xf')](_0x13be01),this['activeAnnotations']=_0x1cc4f0;}[_0x5589('0x11')](_0x3fa313){const _0x5883c7=new Set(this['activeAnnotations']);_0x5883c7[_0x5589('0x10')](_0x3fa313),this[_0x5589('0x5')]=_0x5883c7;}['_bindAnnotationsToVisibleAnnotations'](){const _0x2d2205=this['collection'],_0x522c92=this[_0x5589('0xa')];function _0x5e7d30(_0x35f99e){const _0xe13085=_0x35f99e['source'];_0xe13085[_0x5589('0x6')]&&!_0x522c92[_0x5589('0xb')](_0xe13085)?_0x522c92[_0x5589('0xf')](_0xe13085):!_0xe13085[_0x5589('0x6')]&&_0x522c92['has'](_0xe13085)&&_0x522c92['remove'](_0xe13085),_0xe13085[_0x5589('0x13')][_0x5589('0x1a')][_0x5589('0x14')](_0xe13085[_0x5589('0x13')][_0x5589('0x18')]),_0xe13085[_0x5589('0x13')][_0x5589('0x1a')]['add'](_0xe13085[_0x5589('0x13')][_0x5589('0x18')]);}this['listenTo'](_0x2d2205,_0x5589('0xf'),(_0x18885a,_0x2dcada)=>{_0x2dcada['isVisible']&&_0x522c92[_0x5589('0xf')](_0x2dcada),this['listenTo'](_0x2dcada,_0x5589('0x3'),_0x5e7d30);}),this['listenTo'](_0x2d2205,'remove',(_0x245b7c,_0xb424ff)=>{_0x522c92['has'](_0xb424ff)&&_0x522c92['remove'](_0xb424ff),this[_0x5589('0x1')](_0xb424ff,_0x5589('0x3'),_0x5e7d30);});}}
|