@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,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/annotation
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { Rect, Collection } from 'ckeditor5/src/utils';
|
|
10
|
-
import type { View } from 'ckeditor5/src/ui';
|
|
11
|
-
import type AnnotationView from './view/annotationview';
|
|
12
|
-
import type { AnnotationOptions } from './annotations';
|
|
13
|
-
declare const Annotation_base: {
|
|
14
|
-
new (): import("ckeditor5/src/utils").Observable;
|
|
15
|
-
prototype: import("ckeditor5/src/utils").Observable;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Represents an annotation.
|
|
19
|
-
*
|
|
20
|
-
* Annotation is an entity that combines an {@link module:comments/annotations/view/annotationview~AnnotationView}
|
|
21
|
-
* and an annotation target (a DOM element or a {@link module:utils/dom/rect~Rect}) to which the annotation is bound.
|
|
22
|
-
*/
|
|
23
|
-
export default class Annotation extends Annotation_base {
|
|
24
|
-
/**
|
|
25
|
-
* The visibility of the annotation. Annotations that are not visible, are filtered from Annotation UI collections.
|
|
26
|
-
*
|
|
27
|
-
* @observable
|
|
28
|
-
*/
|
|
29
|
-
isVisible: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* The annotation view.
|
|
32
|
-
*/
|
|
33
|
-
view: AnnotationView;
|
|
34
|
-
/**
|
|
35
|
-
* A collection of DOM elements which, when focused, make the annotation active.
|
|
36
|
-
*
|
|
37
|
-
* By default, this collection only contains the annotation view element.
|
|
38
|
-
* It can be extended with custom targets that will be tracked by the annotation focus tracking system.
|
|
39
|
-
*/
|
|
40
|
-
focusableElements: Collection<HTMLElement>;
|
|
41
|
-
/**
|
|
42
|
-
* Creates an instance of the {@link module:comments/annotations/annotation~Annotation}.
|
|
43
|
-
*/
|
|
44
|
-
constructor({ view, target, type, isVisible }: AnnotationOptions);
|
|
45
|
-
/**
|
|
46
|
-
* The type of the annotation.
|
|
47
|
-
*/
|
|
48
|
-
get type(): string;
|
|
49
|
-
/**
|
|
50
|
-
* The annotation inner view.
|
|
51
|
-
*
|
|
52
|
-
* It is the view that is wrapped by the annotation view.*
|
|
53
|
-
*/
|
|
54
|
-
get innerView(): View;
|
|
55
|
-
/**
|
|
56
|
-
* The annotation target to which the annotation view should be pinned.
|
|
57
|
-
*
|
|
58
|
-
* It can be an array of DOM elements or {@link module:utils/dom/rect~Rect a rect instance} or `null`.
|
|
59
|
-
*/
|
|
60
|
-
get target(): Rect | Array<HTMLElement> | null;
|
|
61
|
-
/**
|
|
62
|
-
* The position and dimensions of the annotation target to which the annotation is bound.
|
|
63
|
-
*/
|
|
64
|
-
get targetRect(): Rect | null;
|
|
65
|
-
/**
|
|
66
|
-
* The state of the annotation.
|
|
67
|
-
*/
|
|
68
|
-
get isActive(): boolean;
|
|
69
|
-
set isActive(value: boolean);
|
|
70
|
-
/**
|
|
71
|
-
* Updates the target rect in the annotation view instance.
|
|
72
|
-
*/
|
|
73
|
-
updateTargetRect(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Clears all event listeners and internal collections.
|
|
76
|
-
*/
|
|
77
|
-
destroy(): void;
|
|
78
|
-
/**
|
|
79
|
-
* Refreshes the visibility of the annotation based on the visibility of the annotation target.
|
|
80
|
-
*
|
|
81
|
-
* It sets the {@link #isVisible} property when the target is not attached to DOM or if the target or its descendant has
|
|
82
|
-
* set the `display` attribute to `none`.
|
|
83
|
-
*
|
|
84
|
-
* This method only updates an annotation if the annotation target is an HTML Element.
|
|
85
|
-
*/
|
|
86
|
-
refreshVisibility(): void;
|
|
87
|
-
}
|
|
88
|
-
type Target = Rect | HTMLElement | null;
|
|
89
|
-
export type AnnotationTarget = Target | (() => Target | Array<Target>);
|
|
90
|
-
export {};
|
|
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/annotation
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Rect, Collection } from 'ckeditor5/src/utils';
|
|
10
|
+
import type { View } from 'ckeditor5/src/ui';
|
|
11
|
+
import type AnnotationView from './view/annotationview';
|
|
12
|
+
import type { AnnotationOptions } from './annotations';
|
|
13
|
+
declare const Annotation_base: {
|
|
14
|
+
new (): import("ckeditor5/src/utils").Observable;
|
|
15
|
+
prototype: import("ckeditor5/src/utils").Observable;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Represents an annotation.
|
|
19
|
+
*
|
|
20
|
+
* Annotation is an entity that combines an {@link module:comments/annotations/view/annotationview~AnnotationView}
|
|
21
|
+
* and an annotation target (a DOM element or a {@link module:utils/dom/rect~Rect}) to which the annotation is bound.
|
|
22
|
+
*/
|
|
23
|
+
export default class Annotation extends Annotation_base {
|
|
24
|
+
/**
|
|
25
|
+
* The visibility of the annotation. Annotations that are not visible, are filtered from Annotation UI collections.
|
|
26
|
+
*
|
|
27
|
+
* @observable
|
|
28
|
+
*/
|
|
29
|
+
isVisible: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The annotation view.
|
|
32
|
+
*/
|
|
33
|
+
view: AnnotationView;
|
|
34
|
+
/**
|
|
35
|
+
* A collection of DOM elements which, when focused, make the annotation active.
|
|
36
|
+
*
|
|
37
|
+
* By default, this collection only contains the annotation view element.
|
|
38
|
+
* It can be extended with custom targets that will be tracked by the annotation focus tracking system.
|
|
39
|
+
*/
|
|
40
|
+
focusableElements: Collection<HTMLElement>;
|
|
41
|
+
/**
|
|
42
|
+
* Creates an instance of the {@link module:comments/annotations/annotation~Annotation}.
|
|
43
|
+
*/
|
|
44
|
+
constructor({ view, target, type, isVisible }: AnnotationOptions);
|
|
45
|
+
/**
|
|
46
|
+
* The type of the annotation.
|
|
47
|
+
*/
|
|
48
|
+
get type(): string;
|
|
49
|
+
/**
|
|
50
|
+
* The annotation inner view.
|
|
51
|
+
*
|
|
52
|
+
* It is the view that is wrapped by the annotation view.*
|
|
53
|
+
*/
|
|
54
|
+
get innerView(): View;
|
|
55
|
+
/**
|
|
56
|
+
* The annotation target to which the annotation view should be pinned.
|
|
57
|
+
*
|
|
58
|
+
* It can be an array of DOM elements or {@link module:utils/dom/rect~Rect a rect instance} or `null`.
|
|
59
|
+
*/
|
|
60
|
+
get target(): Rect | Array<HTMLElement> | null;
|
|
61
|
+
/**
|
|
62
|
+
* The position and dimensions of the annotation target to which the annotation is bound.
|
|
63
|
+
*/
|
|
64
|
+
get targetRect(): Rect | null;
|
|
65
|
+
/**
|
|
66
|
+
* The state of the annotation.
|
|
67
|
+
*/
|
|
68
|
+
get isActive(): boolean;
|
|
69
|
+
set isActive(value: boolean);
|
|
70
|
+
/**
|
|
71
|
+
* Updates the target rect in the annotation view instance.
|
|
72
|
+
*/
|
|
73
|
+
updateTargetRect(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Clears all event listeners and internal collections.
|
|
76
|
+
*/
|
|
77
|
+
destroy(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Refreshes the visibility of the annotation based on the visibility of the annotation target.
|
|
80
|
+
*
|
|
81
|
+
* It sets the {@link #isVisible} property when the target is not attached to DOM or if the target or its descendant has
|
|
82
|
+
* set the `display` attribute to `none`.
|
|
83
|
+
*
|
|
84
|
+
* This method only updates an annotation if the annotation target is an HTML Element.
|
|
85
|
+
*/
|
|
86
|
+
refreshVisibility(): void;
|
|
87
|
+
}
|
|
88
|
+
type Target = Rect | HTMLElement | null;
|
|
89
|
+
export type AnnotationTarget = Target | (() => Target | Array<Target>);
|
|
90
|
+
export {};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5253=['_id','focusTracker','isArray','mainView','innerView','type','nodeType','remove','updateTargetRect','targetRect','filter','set','offsetParent','_type','stopListening','_target','focusableElements','object','annotation-invalid-target','destroy','length','target','view','clear','isActive','getClientRects','isVisible','item','add','render','_getNormalizedTarget','_assertCorrectTarget','function'];(function(_0x2d4b0c,_0x52532d){const _0x16ec90=function(_0x162428){while(--_0x162428){_0x2d4b0c['push'](_0x2d4b0c['shift']());}};_0x16ec90(++_0x52532d);}(_0x5253,0x122));const _0x16ec=function(_0x2d4b0c,_0x52532d){_0x2d4b0c=_0x2d4b0c-0x0;let _0x16ec90=_0x5253[_0x2d4b0c];return _0x16ec90;};import{CKEditorError as _0x1564fe,Rect as _0x3ae695,Collection as _0x248cdc,ObservableMixin as _0x209af1}from'ckeditor5/src/utils';export default class d extends _0x209af1(){constructor({view:_0x230d3c,target:_0x315fc2,type:_0x376ebb,isVisible:_0x2afc24=!0x0}){super(),this[_0x16ec('0x1d')]=_0x230d3c,this[_0x16ec('0x1d')]['element']||this['view'][_0x16ec('0x3')](),this[_0x16ec('0x14')]=_0x376ebb,this[_0x16ec('0x16')]=_0x315fc2,d[_0x16ec('0x5')](this[_0x16ec('0x4')]()),this[_0x16ec('0x17')]=new _0x248cdc([this[_0x16ec('0x1d')]['element']],{'idProperty':_0x16ec('0x7')}),this[_0x16ec('0x17')]['on'](_0x16ec('0x2'),(_0x51cdbf,_0x1696bf)=>{this[_0x16ec('0x1d')]['focusTracker'][_0x16ec('0x2')](_0x1696bf);}),this[_0x16ec('0x17')]['on'](_0x16ec('0xe'),(_0x5759db,_0x421c5b)=>{this[_0x16ec('0x1d')][_0x16ec('0x8')][_0x16ec('0xe')](_0x421c5b);}),this[_0x16ec('0x12')](_0x16ec('0x0'),_0x2afc24);}get[_0x16ec('0xc')](){return _0x16ec('0x6')==typeof this[_0x16ec('0x14')]?this[_0x16ec('0x14')]():this[_0x16ec('0x14')];}get[_0x16ec('0xb')](){return this[_0x16ec('0x1d')][_0x16ec('0xa')];}get['target'](){const _0x4a1acf=this[_0x16ec('0x4')]();return d['_assertCorrectTarget'](_0x4a1acf),_0x4a1acf;}get[_0x16ec('0x10')](){const _0x135c2f=this[_0x16ec('0x1c')];if(null===_0x135c2f)return null;if(_0x135c2f instanceof _0x3ae695)return _0x135c2f;const _0x2faaa6=_0x135c2f[_0x16ec('0x11')](_0x30810d=>function(_0x3e85f4){const _0x38b247=_0x3e85f4[_0x16ec('0x13')];if(_0x38b247)return!0x0;const _0x5c70be=_0x3e85f4['getClientRects']()[_0x16ec('0x1')](0x0);return!!_0x5c70be;}(_0x30810d));return 0x0===_0x2faaa6[_0x16ec('0x1b')]?null:new _0x3ae695(_0x2faaa6[0x0][_0x16ec('0x20')]()['item'](0x0));}get[_0x16ec('0x1f')](){return this[_0x16ec('0x1d')]['isActive'];}set['isActive'](_0x50505d){this[_0x16ec('0x1d')][_0x16ec('0x1f')]=_0x50505d,this[_0x16ec('0x1d')][_0x16ec('0xa')]['isActive']=_0x50505d;}[_0x16ec('0xf')](){this[_0x16ec('0x1d')][_0x16ec('0x10')]=this[_0x16ec('0x10')];}[_0x16ec('0x1a')](){this['focusableElements'][_0x16ec('0x15')](),this['focusableElements'][_0x16ec('0x1e')](),this[_0x16ec('0x15')]();}['refreshVisibility'](){this['isVisible']=!!this['targetRect'];}static[_0x16ec('0x5')](_0x5890bf){if(!(null===_0x5890bf||_0x5890bf instanceof _0x3ae695||Array[_0x16ec('0x9')](_0x5890bf)&&_0x5890bf['every'](_0x5cb008=>y(_0x5cb008))))throw new _0x1564fe(_0x16ec('0x19'),null,{'target':_0x5890bf});}['_getNormalizedTarget'](){const _0x37ca12=_0x16ec('0x6')==typeof this[_0x16ec('0x16')]?this[_0x16ec('0x16')]():this[_0x16ec('0x16')];return y(_0x37ca12)?[_0x37ca12]:_0x37ca12;}}function y(_0x56c62c){return null!==_0x56c62c&&_0x16ec('0x18')==typeof _0x56c62c&&_0x16ec('0xd')in _0x56c62c&&0x1===_0x56c62c['nodeType'];}
|
|
@@ -1,98 +1,98 @@
|
|
|
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/annotationcollection
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { Collection } from 'ckeditor5/src/utils';
|
|
10
|
-
import type { View } from 'ckeditor5/src/ui';
|
|
11
|
-
import type Annotation from './annotation';
|
|
12
|
-
/**
|
|
13
|
-
* A collection of {@link module:comments/annotations/annotation~Annotation annotations}.
|
|
14
|
-
*
|
|
15
|
-
* It implements methods for managing annotations and creates a focus tracker for them to make it easier to manage
|
|
16
|
-
* the focus for all annotations.
|
|
17
|
-
*
|
|
18
|
-
* `AnnotationCollection` fires {@link module:comments/annotations/annotationcollection~AnnotationCollection#event:focus} when an annotation
|
|
19
|
-
* becomes focused and {@link module:comments/annotations/annotationcollection~AnnotationCollection#event:blur} when all annotations
|
|
20
|
-
* lose focus.
|
|
21
|
-
*/
|
|
22
|
-
export default class AnnotationCollection extends Collection<Annotation> {
|
|
23
|
-
/**
|
|
24
|
-
* @param annotations Initial annotations.
|
|
25
|
-
*/
|
|
26
|
-
constructor(annotations?: Iterable<Annotation>);
|
|
27
|
-
/**
|
|
28
|
-
* Equals to `true` when one of the annotation in the collection is focused.
|
|
29
|
-
*/
|
|
30
|
-
get isFocused(): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Adds an annotation to the collection.
|
|
33
|
-
*/
|
|
34
|
-
add(annotation: Annotation): this;
|
|
35
|
-
/**
|
|
36
|
-
* Removes the annotation from the collection.
|
|
37
|
-
*/
|
|
38
|
-
remove(annotation: Annotation): Annotation;
|
|
39
|
-
/**
|
|
40
|
-
* Gets the annotation for a given annotation view's inner view.
|
|
41
|
-
*/
|
|
42
|
-
getByInnerView(innerView: View): Annotation | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Gets the annotation for a given annotation view.
|
|
45
|
-
*/
|
|
46
|
-
getByView(view: View): Annotation | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* Destroys all bindings and clears the collection.
|
|
49
|
-
*/
|
|
50
|
-
destroy(): void;
|
|
51
|
-
/**
|
|
52
|
-
* Refreshes the positioning of all annotations and sorts them topmost and leftmost.
|
|
53
|
-
*/
|
|
54
|
-
refreshPositioning(): void;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Fired when an annotation becomes active.
|
|
58
|
-
*
|
|
59
|
-
* @eventName ~AnnotationCollection#focus
|
|
60
|
-
* @param annotation An annotation that was focused.
|
|
61
|
-
*/
|
|
62
|
-
export type AnnotationFocusEvent = {
|
|
63
|
-
name: 'focus';
|
|
64
|
-
args: [annotation: Annotation];
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Fired when all annotations become blurred.
|
|
68
|
-
*
|
|
69
|
-
* @eventName ~AnnotationCollection#blur
|
|
70
|
-
*/
|
|
71
|
-
export type AnnotationBlurEvent = {
|
|
72
|
-
name: 'blur';
|
|
73
|
-
args: [];
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* A helper function that binds two {@link module:comments/annotations/annotationcollection~AnnotationCollection AnnotationCollection}s
|
|
77
|
-
* and allows filtering items based on the passed callback.
|
|
78
|
-
*
|
|
79
|
-
* Since {@link module:comments/annotations/annotationcollection~AnnotationCollection#refreshPositioning}
|
|
80
|
-
* sorts the annotations by removing and inserting items, the binding implemented by the `bindTo()` method is lost. This is why
|
|
81
|
-
* this helper needs to be used.
|
|
82
|
-
*
|
|
83
|
-
* This helper is used by the annotations UIs to filter which annotations from the
|
|
84
|
-
* {@link module:comments/annotations/annotations~Annotations#collection main annotation collection} should be handled by
|
|
85
|
-
* a given annotations UI.
|
|
86
|
-
*
|
|
87
|
-
* @param `options.source` The source collection
|
|
88
|
-
* from which the annotations will be taken.
|
|
89
|
-
* @param `options.target` The target collection
|
|
90
|
-
* that will be synced to the source collection.
|
|
91
|
-
* @param options.filter Filtering function that gets an annotation and should return `true` if the annotation should be
|
|
92
|
-
* copied to the `target` collection.
|
|
93
|
-
*/
|
|
94
|
-
export declare function bindAnnotationCollections({ source, target, filter }: {
|
|
95
|
-
source: AnnotationCollection;
|
|
96
|
-
target: AnnotationCollection;
|
|
97
|
-
filter: (annotation: Annotation) => boolean;
|
|
98
|
-
}): void;
|
|
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/annotationcollection
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Collection } from 'ckeditor5/src/utils';
|
|
10
|
+
import type { View } from 'ckeditor5/src/ui';
|
|
11
|
+
import type Annotation from './annotation';
|
|
12
|
+
/**
|
|
13
|
+
* A collection of {@link module:comments/annotations/annotation~Annotation annotations}.
|
|
14
|
+
*
|
|
15
|
+
* It implements methods for managing annotations and creates a focus tracker for them to make it easier to manage
|
|
16
|
+
* the focus for all annotations.
|
|
17
|
+
*
|
|
18
|
+
* `AnnotationCollection` fires {@link module:comments/annotations/annotationcollection~AnnotationCollection#event:focus} when an annotation
|
|
19
|
+
* becomes focused and {@link module:comments/annotations/annotationcollection~AnnotationCollection#event:blur} when all annotations
|
|
20
|
+
* lose focus.
|
|
21
|
+
*/
|
|
22
|
+
export default class AnnotationCollection extends Collection<Annotation> {
|
|
23
|
+
/**
|
|
24
|
+
* @param annotations Initial annotations.
|
|
25
|
+
*/
|
|
26
|
+
constructor(annotations?: Iterable<Annotation>);
|
|
27
|
+
/**
|
|
28
|
+
* Equals to `true` when one of the annotation in the collection is focused.
|
|
29
|
+
*/
|
|
30
|
+
get isFocused(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Adds an annotation to the collection.
|
|
33
|
+
*/
|
|
34
|
+
add(annotation: Annotation): this;
|
|
35
|
+
/**
|
|
36
|
+
* Removes the annotation from the collection.
|
|
37
|
+
*/
|
|
38
|
+
remove(annotation: Annotation): Annotation;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the annotation for a given annotation view's inner view.
|
|
41
|
+
*/
|
|
42
|
+
getByInnerView(innerView: View): Annotation | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Gets the annotation for a given annotation view.
|
|
45
|
+
*/
|
|
46
|
+
getByView(view: View): Annotation | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Destroys all bindings and clears the collection.
|
|
49
|
+
*/
|
|
50
|
+
destroy(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Refreshes the positioning of all annotations and sorts them topmost and leftmost.
|
|
53
|
+
*/
|
|
54
|
+
refreshPositioning(): void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Fired when an annotation becomes active.
|
|
58
|
+
*
|
|
59
|
+
* @eventName ~AnnotationCollection#focus
|
|
60
|
+
* @param annotation An annotation that was focused.
|
|
61
|
+
*/
|
|
62
|
+
export type AnnotationFocusEvent = {
|
|
63
|
+
name: 'focus';
|
|
64
|
+
args: [annotation: Annotation];
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Fired when all annotations become blurred.
|
|
68
|
+
*
|
|
69
|
+
* @eventName ~AnnotationCollection#blur
|
|
70
|
+
*/
|
|
71
|
+
export type AnnotationBlurEvent = {
|
|
72
|
+
name: 'blur';
|
|
73
|
+
args: [];
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* A helper function that binds two {@link module:comments/annotations/annotationcollection~AnnotationCollection AnnotationCollection}s
|
|
77
|
+
* and allows filtering items based on the passed callback.
|
|
78
|
+
*
|
|
79
|
+
* Since {@link module:comments/annotations/annotationcollection~AnnotationCollection#refreshPositioning}
|
|
80
|
+
* sorts the annotations by removing and inserting items, the binding implemented by the `bindTo()` method is lost. This is why
|
|
81
|
+
* this helper needs to be used.
|
|
82
|
+
*
|
|
83
|
+
* This helper is used by the annotations UIs to filter which annotations from the
|
|
84
|
+
* {@link module:comments/annotations/annotations~Annotations#collection main annotation collection} should be handled by
|
|
85
|
+
* a given annotations UI.
|
|
86
|
+
*
|
|
87
|
+
* @param `options.source` The source collection
|
|
88
|
+
* from which the annotations will be taken.
|
|
89
|
+
* @param `options.target` The target collection
|
|
90
|
+
* that will be synced to the source collection.
|
|
91
|
+
* @param options.filter Filtering function that gets an annotation and should return `true` if the annotation should be
|
|
92
|
+
* copied to the `target` collection.
|
|
93
|
+
*/
|
|
94
|
+
export declare function bindAnnotationCollections({ source, target, filter }: {
|
|
95
|
+
source: AnnotationCollection;
|
|
96
|
+
target: AnnotationCollection;
|
|
97
|
+
filter: (annotation: Annotation) => boolean;
|
|
98
|
+
}): void;
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x300a=['clear','blur','_viewToAnnotation','refreshPositioning','focus','targetRect','innerView','_getOrderInContent','_sort','sort','stopListening','getIndex','isFocused','annotationcollection-duplicated-item','get','top','destroy','_focusTracker','view','set','focusTracker','from','getByView','annotationcollection-not-existing-item','remove','updateTargetRect','delete','focusableElements','_innerViewToAnnotation','add','change:isFocused','listenTo','fire','length','has','left'];(function(_0x47293b,_0x300ad2){const _0x2aa787=function(_0x4d1f77){while(--_0x4d1f77){_0x47293b['push'](_0x47293b['shift']());}};_0x2aa787(++_0x300ad2);}(_0x300a,0x18f));const _0x2aa7=function(_0x47293b,_0x300ad2){_0x47293b=_0x47293b-0x0;let _0x2aa787=_0x300a[_0x47293b];return _0x2aa787;};import{CKEditorError as _0xe8b752,Collection as _0x5a8df0,FocusTracker as _0xbd9cbf}from'ckeditor5/src/utils';export default class x extends _0x5a8df0{constructor(_0x5563ff=[]){super(),this[_0x2aa7('0x19')]=new Map(),this[_0x2aa7('0x23')]=new Map(),this[_0x2aa7('0xe')]=new _0xbd9cbf(),this[_0x2aa7('0xe')]['on'](_0x2aa7('0x1b'),(_0x5cab3b,_0x2760fe,_0x49a8a7)=>{_0x49a8a7||this['fire'](_0x2aa7('0x22'));});for(const _0x4d0933 of _0x5563ff)this[_0x2aa7('0x1a')](_0x4d0933);}get[_0x2aa7('0x9')](){return this[_0x2aa7('0xe')]['isFocused'];}[_0x2aa7('0x1a')](_0x565a90){if(this[_0x2aa7('0x1f')](_0x565a90))throw new _0xe8b752(_0x2aa7('0xa'),null);this['_innerViewToAnnotation'][_0x2aa7('0x10')](_0x565a90[_0x2aa7('0x3')],_0x565a90),this[_0x2aa7('0x23')]['set'](_0x565a90[_0x2aa7('0xf')],_0x565a90);for(const _0x2ebe89 of _0x565a90[_0x2aa7('0x18')])this[_0x2aa7('0xe')][_0x2aa7('0x1a')](_0x2ebe89);this[_0x2aa7('0x1c')](_0x565a90[_0x2aa7('0x18')],_0x2aa7('0x1a'),(_0x5659fc,_0x5c2842)=>{this[_0x2aa7('0xe')][_0x2aa7('0x1a')](_0x5c2842);}),this[_0x2aa7('0x1c')](_0x565a90[_0x2aa7('0x18')],_0x2aa7('0x15'),(_0x280d93,_0x4ffbf8)=>{this[_0x2aa7('0xe')][_0x2aa7('0x15')](_0x4ffbf8);}),this['listenTo'](_0x565a90[_0x2aa7('0xf')][_0x2aa7('0x11')],_0x2aa7('0x1b'),(_0x186994,_0x47f681,_0x493958)=>{_0x493958&&this[_0x2aa7('0x1d')](_0x2aa7('0x1'),_0x565a90);}),_0x565a90[_0x2aa7('0x16')]();const _0x715f5e=this[_0x2aa7('0x4')](_0x565a90[_0x2aa7('0xf')][_0x2aa7('0x2')]);return super[_0x2aa7('0x1a')](_0x565a90,_0x715f5e);}[_0x2aa7('0x15')](_0x3958ac){if(!this[_0x2aa7('0x1f')](_0x3958ac))throw new _0xe8b752(_0x2aa7('0x14'),null);this[_0x2aa7('0x7')](_0x3958ac['view'][_0x2aa7('0x11')]),this[_0x2aa7('0x7')](_0x3958ac[_0x2aa7('0x18')]);for(const _0x1655ad of _0x3958ac[_0x2aa7('0x18')])this[_0x2aa7('0xe')][_0x2aa7('0x15')](_0x1655ad);return this[_0x2aa7('0x23')][_0x2aa7('0x17')](_0x3958ac['view']),this[_0x2aa7('0x19')][_0x2aa7('0x17')](_0x3958ac[_0x2aa7('0x3')]),super[_0x2aa7('0x15')](_0x3958ac);}['getByInnerView'](_0x1bf81a){return this[_0x2aa7('0x19')]['get'](_0x1bf81a);}[_0x2aa7('0x13')](_0x1b432e){return this[_0x2aa7('0x23')][_0x2aa7('0xb')](_0x1b432e);}['destroy'](){super[_0x2aa7('0x21')](),this['stopListening'](),this['_innerViewToAnnotation'][_0x2aa7('0x21')](),this['_viewToAnnotation'][_0x2aa7('0x21')](),this[_0x2aa7('0xe')][_0x2aa7('0xd')]();}[_0x2aa7('0x0')](){for(const _0x4f4c64 of this)_0x4f4c64[_0x2aa7('0x16')]();this['_sort']();}[_0x2aa7('0x5')](){const _0x19cdf2=Array[_0x2aa7('0x12')](this)[_0x2aa7('0x6')]((_0x44a2fe,_0x144263)=>v(_0x44a2fe['view'][_0x2aa7('0x2')],_0x144263[_0x2aa7('0xf')]['targetRect']));for(let _0x5ad0db=_0x19cdf2[_0x2aa7('0x1e')]-0x1;_0x5ad0db>0x0;_0x5ad0db--){const _0x4c4cc4=_0x19cdf2[_0x5ad0db];_0x5ad0db!==this[_0x2aa7('0x8')](_0x4c4cc4)&&(this[_0x2aa7('0x15')](_0x4c4cc4),this['add'](_0x4c4cc4));}}[_0x2aa7('0x4')](_0x1baa72){let _0xcbcef6=0x0;if(!_0x1baa72)return this[_0x2aa7('0x1e')];for(const _0x3ae349 of this){const _0x4f43ba=_0x3ae349['view'][_0x2aa7('0x2')];if(_0x4f43ba){if(v(_0x1baa72,_0x4f43ba)<0x0)return _0xcbcef6;_0xcbcef6++;}}return _0xcbcef6;}}export function bindAnnotationCollections({source:_0x458f95,target:_0xc6af4c,filter:_0x2a19b5}){for(const _0x2782fc of _0x458f95)_0x2a19b5(_0x2782fc)&&_0xc6af4c[_0x2aa7('0x1a')](_0x2782fc);_0xc6af4c[_0x2aa7('0x1c')](_0x458f95,'add',(_0x6db8dc,_0x2c7e9b)=>{_0x2a19b5(_0x2c7e9b)&&_0xc6af4c['add'](_0x2c7e9b);}),_0xc6af4c['listenTo'](_0x458f95,_0x2aa7('0x15'),(_0x598ab2,_0x54a55f)=>{_0xc6af4c['has'](_0x54a55f)&&_0xc6af4c[_0x2aa7('0x15')](_0x54a55f);});}function v(_0x1cd544,_0x2d6eb5){if(null===_0x1cd544&&null===_0x2d6eb5)return 0x0;if(null===_0x1cd544)return-0x1;if(null===_0x2d6eb5)return 0x1;const _0x2d5c9b=_0x1cd544[_0x2aa7('0xc')]-_0x2d6eb5[_0x2aa7('0xc')];return 0x0==_0x2d5c9b?_0x1cd544[_0x2aa7('0x20')]-_0x2d6eb5['left']:_0x2d5c9b;}
|