@ckeditor/ckeditor5-comments 38.1.0 → 38.1.1

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.
Files changed (85) hide show
  1. package/build/comments.js +1 -1
  2. package/package.json +3 -3
  3. package/src/annotations/annotation.d.ts +86 -86
  4. package/src/annotations/annotation.js +1 -1
  5. package/src/annotations/annotationcollection.d.ts +94 -94
  6. package/src/annotations/annotationcollection.js +1 -1
  7. package/src/annotations/annotations.d.ts +150 -150
  8. package/src/annotations/annotations.js +1 -1
  9. package/src/annotations/annotationsuis.d.ts +228 -228
  10. package/src/annotations/annotationsuis.js +1 -1
  11. package/src/annotations/editorannotations.d.ts +63 -63
  12. package/src/annotations/editorannotations.js +1 -1
  13. package/src/annotations/inlineannotations.d.ts +86 -86
  14. package/src/annotations/inlineannotations.js +1 -1
  15. package/src/annotations/narrowsidebar.d.ts +81 -81
  16. package/src/annotations/narrowsidebar.js +1 -1
  17. package/src/annotations/sidebar.d.ts +96 -96
  18. package/src/annotations/sidebar.js +1 -1
  19. package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -25
  20. package/src/annotations/view/annotationcounterbuttonview.js +1 -1
  21. package/src/annotations/view/annotationview.d.ts +86 -86
  22. package/src/annotations/view/annotationview.js +1 -1
  23. package/src/annotations/view/sidebaritemview.d.ts +51 -51
  24. package/src/annotations/view/sidebaritemview.js +1 -1
  25. package/src/annotations/view/sidebarview.d.ts +28 -28
  26. package/src/annotations/view/sidebarview.js +1 -1
  27. package/src/annotations/widesidebar.d.ts +73 -73
  28. package/src/annotations/widesidebar.js +1 -1
  29. package/src/augmentation.d.ts +48 -48
  30. package/src/comments/addcommentthreadcommand.d.ts +31 -31
  31. package/src/comments/addcommentthreadcommand.js +1 -1
  32. package/src/comments/commentsarchive.d.ts +27 -27
  33. package/src/comments/commentsarchive.js +1 -1
  34. package/src/comments/commentsarchiveui.d.ts +34 -34
  35. package/src/comments/commentsarchiveui.js +1 -1
  36. package/src/comments/commentsediting.d.ts +75 -75
  37. package/src/comments/commentsediting.js +1 -1
  38. package/src/comments/commentsrepository.d.ts +1088 -1088
  39. package/src/comments/commentsrepository.js +1 -1
  40. package/src/comments/commentsui.d.ts +29 -29
  41. package/src/comments/commentsui.js +1 -1
  42. package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -13
  43. package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
  44. package/src/comments/integrations/importword.d.ts +17 -17
  45. package/src/comments/integrations/importword.js +1 -1
  46. package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -32
  47. package/src/comments/ui/commenteditor/commenteditor.js +1 -1
  48. package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -27
  49. package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
  50. package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -32
  51. package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
  52. package/src/comments/ui/commentthreadcontroller.d.ts +64 -64
  53. package/src/comments/ui/commentthreadcontroller.js +1 -1
  54. package/src/comments/ui/view/basecommentthreadview.d.ts +108 -108
  55. package/src/comments/ui/view/basecommentthreadview.js +1 -1
  56. package/src/comments/ui/view/basecommentview.d.ts +108 -108
  57. package/src/comments/ui/view/basecommentview.js +1 -1
  58. package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -9
  59. package/src/comments/ui/view/collapsedcommentsview.js +1 -1
  60. package/src/comments/ui/view/commentcontentview.d.ts +10 -10
  61. package/src/comments/ui/view/commentcontentview.js +1 -1
  62. package/src/comments/ui/view/commentinputview.d.ts +82 -82
  63. package/src/comments/ui/view/commentinputview.js +1 -1
  64. package/src/comments/ui/view/commentsarchiveview.d.ts +34 -34
  65. package/src/comments/ui/view/commentsarchiveview.js +1 -1
  66. package/src/comments/ui/view/commentslistview.d.ts +96 -96
  67. package/src/comments/ui/view/commentslistview.js +1 -1
  68. package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -46
  69. package/src/comments/ui/view/commentthreadheaderview.js +1 -1
  70. package/src/comments/ui/view/commentthreadinputview.d.ts +37 -37
  71. package/src/comments/ui/view/commentthreadinputview.js +1 -1
  72. package/src/comments/ui/view/commentthreadview.d.ts +113 -113
  73. package/src/comments/ui/view/commentthreadview.js +1 -1
  74. package/src/comments/ui/view/commentview.d.ts +239 -239
  75. package/src/comments/ui/view/commentview.js +1 -1
  76. package/src/comments.d.ts +31 -31
  77. package/src/comments.js +1 -1
  78. package/src/commentsonly.d.ts +29 -29
  79. package/src/commentsonly.js +1 -1
  80. package/src/config.d.ts +172 -172
  81. package/src/index.d.ts +21 -21
  82. package/src/utils/common-translations.d.ts +5 -5
  83. package/src/utils/common-translations.js +1 -1
  84. package/src/utils/createmutationobserver.d.ts +13 -13
  85. package/src/utils/createmutationobserver.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-comments",
3
- "version": "38.1.0",
3
+ "version": "38.1.1",
4
4
  "description": "Collaborative comments feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -43,8 +43,8 @@
43
43
  "CHANGELOG.md"
44
44
  ],
45
45
  "dependencies": {
46
- "ckeditor5": "38.1.0",
47
- "ckeditor5-collaboration": "38.1.0",
46
+ "ckeditor5": "38.1.1",
47
+ "ckeditor5-collaboration": "38.1.1",
48
48
  "lodash-es": "^4.17.11"
49
49
  },
50
50
  "engines": {
@@ -1,86 +1,86 @@
1
- /**
2
- * @module comments/annotations/annotation
3
- * @publicApi
4
- */
5
- import { Rect, Collection } from 'ckeditor5/src/utils';
6
- import type { View } from 'ckeditor5/src/ui';
7
- import type AnnotationView from './view/annotationview';
8
- import type { AnnotationOptions } from './annotations';
9
- declare const Annotation_base: {
10
- new (): import("ckeditor5/src/utils").Observable;
11
- prototype: import("ckeditor5/src/utils").Observable;
12
- };
13
- /**
14
- * Represents an annotation.
15
- *
16
- * Annotation is an entity that combines an {@link module:comments/annotations/view/annotationview~AnnotationView}
17
- * and an annotation target (a DOM element or a {@link module:utils/dom/rect~Rect}) to which the annotation is bound.
18
- */
19
- export default class Annotation extends Annotation_base {
20
- /**
21
- * The visibility of the annotation. Annotations that are not visible, are filtered from Annotation UI collections.
22
- *
23
- * @observable
24
- */
25
- isVisible: boolean;
26
- /**
27
- * The annotation view.
28
- */
29
- view: AnnotationView;
30
- /**
31
- * A collection of DOM elements which, when focused, make the annotation active.
32
- *
33
- * By default, this collection only contains the annotation view element.
34
- * It can be extended with custom targets that will be tracked by the annotation focus tracking system.
35
- */
36
- focusableElements: Collection<HTMLElement>;
37
- /**
38
- * Creates an instance of the {@link module:comments/annotations/annotation~Annotation}.
39
- */
40
- constructor({ view, target, type, isVisible }: AnnotationOptions);
41
- /**
42
- * The type of the annotation.
43
- */
44
- get type(): string;
45
- /**
46
- * The annotation inner view.
47
- *
48
- * It is the view that is wrapped by the annotation view.*
49
- */
50
- get innerView(): View;
51
- /**
52
- * The annotation target to which the annotation view should be pinned.
53
- *
54
- * It can be an array of DOM elements or {@link module:utils/dom/rect~Rect a rect instance} or `null`.
55
- */
56
- get target(): Rect | Array<HTMLElement> | null;
57
- /**
58
- * The position and dimensions of the annotation target to which the annotation is bound.
59
- */
60
- get targetRect(): Rect | null;
61
- /**
62
- * The state of the annotation.
63
- */
64
- get isActive(): boolean;
65
- set isActive(value: boolean);
66
- /**
67
- * Updates the target rect in the annotation view instance.
68
- */
69
- updateTargetRect(): void;
70
- /**
71
- * Clears all event listeners and internal collections.
72
- */
73
- destroy(): void;
74
- /**
75
- * Refreshes the visibility of the annotation based on the visibility of the annotation target.
76
- *
77
- * It sets the {@link #isVisible} property when the target is not attached to DOM or if the target or its descendant has
78
- * set the `display` attribute to `none`.
79
- *
80
- * This method only updates an annotation if the annotation target is an HTML Element.
81
- */
82
- refreshVisibility(): void;
83
- }
84
- type Target = Rect | HTMLElement | null;
85
- export type AnnotationTarget = Target | (() => Target | Array<Target>);
86
- export {};
1
+ /**
2
+ * @module comments/annotations/annotation
3
+ * @publicApi
4
+ */
5
+ import { Rect, Collection } from 'ckeditor5/src/utils';
6
+ import type { View } from 'ckeditor5/src/ui';
7
+ import type AnnotationView from './view/annotationview';
8
+ import type { AnnotationOptions } from './annotations';
9
+ declare const Annotation_base: {
10
+ new (): import("ckeditor5/src/utils").Observable;
11
+ prototype: import("ckeditor5/src/utils").Observable;
12
+ };
13
+ /**
14
+ * Represents an annotation.
15
+ *
16
+ * Annotation is an entity that combines an {@link module:comments/annotations/view/annotationview~AnnotationView}
17
+ * and an annotation target (a DOM element or a {@link module:utils/dom/rect~Rect}) to which the annotation is bound.
18
+ */
19
+ export default class Annotation extends Annotation_base {
20
+ /**
21
+ * The visibility of the annotation. Annotations that are not visible, are filtered from Annotation UI collections.
22
+ *
23
+ * @observable
24
+ */
25
+ isVisible: boolean;
26
+ /**
27
+ * The annotation view.
28
+ */
29
+ view: AnnotationView;
30
+ /**
31
+ * A collection of DOM elements which, when focused, make the annotation active.
32
+ *
33
+ * By default, this collection only contains the annotation view element.
34
+ * It can be extended with custom targets that will be tracked by the annotation focus tracking system.
35
+ */
36
+ focusableElements: Collection<HTMLElement>;
37
+ /**
38
+ * Creates an instance of the {@link module:comments/annotations/annotation~Annotation}.
39
+ */
40
+ constructor({ view, target, type, isVisible }: AnnotationOptions);
41
+ /**
42
+ * The type of the annotation.
43
+ */
44
+ get type(): string;
45
+ /**
46
+ * The annotation inner view.
47
+ *
48
+ * It is the view that is wrapped by the annotation view.*
49
+ */
50
+ get innerView(): View;
51
+ /**
52
+ * The annotation target to which the annotation view should be pinned.
53
+ *
54
+ * It can be an array of DOM elements or {@link module:utils/dom/rect~Rect a rect instance} or `null`.
55
+ */
56
+ get target(): Rect | Array<HTMLElement> | null;
57
+ /**
58
+ * The position and dimensions of the annotation target to which the annotation is bound.
59
+ */
60
+ get targetRect(): Rect | null;
61
+ /**
62
+ * The state of the annotation.
63
+ */
64
+ get isActive(): boolean;
65
+ set isActive(value: boolean);
66
+ /**
67
+ * Updates the target rect in the annotation view instance.
68
+ */
69
+ updateTargetRect(): void;
70
+ /**
71
+ * Clears all event listeners and internal collections.
72
+ */
73
+ destroy(): void;
74
+ /**
75
+ * Refreshes the visibility of the annotation based on the visibility of the annotation target.
76
+ *
77
+ * It sets the {@link #isVisible} property when the target is not attached to DOM or if the target or its descendant has
78
+ * set the `display` attribute to `none`.
79
+ *
80
+ * This method only updates an annotation if the annotation target is an HTML Element.
81
+ */
82
+ refreshVisibility(): void;
83
+ }
84
+ type Target = Rect | HTMLElement | null;
85
+ export type AnnotationTarget = Target | (() => Target | Array<Target>);
86
+ export {};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x1017=['filter','every','object','nodeType','mainView','remove','annotation-invalid-target','function','target','length','_type','type','_getNormalizedTarget','_target','_assertCorrectTarget','add','getClientRects','clear','updateTargetRect','isActive','render','item','focusableElements','focusTracker','set','targetRect','element','stopListening','view','isVisible'];(function(_0x571c0e,_0x101768){const _0x4c8dc4=function(_0x1fb7cc){while(--_0x1fb7cc){_0x571c0e['push'](_0x571c0e['shift']());}};_0x4c8dc4(++_0x101768);}(_0x1017,0x1d2));const _0x4c8d=function(_0x571c0e,_0x101768){_0x571c0e=_0x571c0e-0x0;let _0x4c8dc4=_0x1017[_0x571c0e];return _0x4c8dc4;};import{CKEditorError as _0x3cee42,Rect as _0x59c401,Collection as _0x253e52,ObservableMixin as _0x85e21b}from'ckeditor5/src/utils';export default class d extends _0x85e21b(){constructor({view:_0x2d1a65,target:_0x1f1fee,type:_0x28cc96,isVisible:_0x614c51=!0x0}){super(),this[_0x4c8d('0xc')]=_0x2d1a65,this['view'][_0x4c8d('0xa')]||this[_0x4c8d('0xc')][_0x4c8d('0x4')](),this[_0x4c8d('0x18')]=_0x28cc96,this['_target']=_0x1f1fee,d[_0x4c8d('0x1c')](this[_0x4c8d('0x1a')]()),this[_0x4c8d('0x6')]=new _0x253e52([this[_0x4c8d('0xc')]['element']],{'idProperty':'_id'}),this[_0x4c8d('0x6')]['on'](_0x4c8d('0x1d'),(_0x1b3ebc,_0x1d18b0)=>{this[_0x4c8d('0xc')][_0x4c8d('0x7')][_0x4c8d('0x1d')](_0x1d18b0);}),this[_0x4c8d('0x6')]['on'](_0x4c8d('0x13'),(_0x3e7f6b,_0x2f7354)=>{this['view']['focusTracker']['remove'](_0x2f7354);}),this[_0x4c8d('0x8')](_0x4c8d('0xd'),_0x614c51);}get[_0x4c8d('0x19')](){return _0x4c8d('0x15')==typeof this[_0x4c8d('0x18')]?this[_0x4c8d('0x18')]():this[_0x4c8d('0x18')];}get['innerView'](){return this[_0x4c8d('0xc')][_0x4c8d('0x12')];}get['target'](){const _0x3e8f1d=this[_0x4c8d('0x1a')]();return d[_0x4c8d('0x1c')](_0x3e8f1d),_0x3e8f1d;}get['targetRect'](){const _0x53dd64=this[_0x4c8d('0x16')];if(null===_0x53dd64)return null;if(_0x53dd64 instanceof _0x59c401)return _0x53dd64;const _0x252f6c=_0x53dd64[_0x4c8d('0xe')](_0x2c4d71=>function(_0x26113f){const _0x243d3f=_0x26113f['offsetParent'];if(_0x243d3f)return!0x0;const _0x480f00=_0x26113f[_0x4c8d('0x0')]()['item'](0x0);return!!_0x480f00;}(_0x2c4d71));return 0x0===_0x252f6c[_0x4c8d('0x17')]?null:new _0x59c401(_0x252f6c[0x0]['getClientRects']()[_0x4c8d('0x5')](0x0));}get[_0x4c8d('0x3')](){return this[_0x4c8d('0xc')][_0x4c8d('0x3')];}set[_0x4c8d('0x3')](_0x59f3d6){this[_0x4c8d('0xc')][_0x4c8d('0x3')]=_0x59f3d6,this['view'][_0x4c8d('0x12')][_0x4c8d('0x3')]=_0x59f3d6;}[_0x4c8d('0x2')](){this[_0x4c8d('0xc')][_0x4c8d('0x9')]=this[_0x4c8d('0x9')];}['destroy'](){this[_0x4c8d('0x6')][_0x4c8d('0xb')](),this['focusableElements'][_0x4c8d('0x1')](),this[_0x4c8d('0xb')]();}['refreshVisibility'](){this['isVisible']=!!this[_0x4c8d('0x9')];}static[_0x4c8d('0x1c')](_0x436876){if(!(null===_0x436876||_0x436876 instanceof _0x59c401||Array['isArray'](_0x436876)&&_0x436876[_0x4c8d('0xf')](_0x55b098=>y(_0x55b098))))throw new _0x3cee42(_0x4c8d('0x14'),null,{'target':_0x436876});}[_0x4c8d('0x1a')](){const _0x119115='function'==typeof this[_0x4c8d('0x1b')]?this[_0x4c8d('0x1b')]():this[_0x4c8d('0x1b')];return y(_0x119115)?[_0x119115]:_0x119115;}}function y(_0x23d6e4){return null!==_0x23d6e4&&_0x4c8d('0x10')==typeof _0x23d6e4&&_0x4c8d('0x11')in _0x23d6e4&&0x1===_0x23d6e4[_0x4c8d('0x11')];}
23
+ const _0x16ce=['_type','annotation-invalid-target','set','updateTargetRect','clear','mainView','_target','remove','destroy','item','isVisible','function','element','innerView','add','_getNormalizedTarget','_id','getClientRects','isActive','view','every','type','_assertCorrectTarget','object','targetRect','focusTracker','offsetParent','focusableElements','filter','isArray','refreshVisibility','stopListening','target'];(function(_0x1b4185,_0x16ce2b){const _0xeb53f=function(_0x269a3d){while(--_0x269a3d){_0x1b4185['push'](_0x1b4185['shift']());}};_0xeb53f(++_0x16ce2b);}(_0x16ce,0xd6));const _0xeb53=function(_0x1b4185,_0x16ce2b){_0x1b4185=_0x1b4185-0x0;let _0xeb53f=_0x16ce[_0x1b4185];return _0xeb53f;};import{CKEditorError as _0x3e2b60,Rect as _0x4249d2,Collection as _0x1a5689,ObservableMixin as _0x479358}from'ckeditor5/src/utils';export default class d extends _0x479358(){constructor({view:_0x1960c3,target:_0x40ec48,type:_0x3d4c43,isVisible:_0x41525a=!0x0}){super(),this[_0xeb53('0x3')]=_0x1960c3,this['view'][_0xeb53('0x1d')]||this['view']['render'](),this[_0xeb53('0x11')]=_0x3d4c43,this[_0xeb53('0x17')]=_0x40ec48,d[_0xeb53('0x6')](this[_0xeb53('0x20')]()),this[_0xeb53('0xb')]=new _0x1a5689([this[_0xeb53('0x3')]['element']],{'idProperty':_0xeb53('0x0')}),this['focusableElements']['on'](_0xeb53('0x1f'),(_0x3eaadf,_0x292480)=>{this[_0xeb53('0x3')]['focusTracker']['add'](_0x292480);}),this[_0xeb53('0xb')]['on'](_0xeb53('0x18'),(_0x4e8d59,_0x73635c)=>{this[_0xeb53('0x3')][_0xeb53('0x9')][_0xeb53('0x18')](_0x73635c);}),this[_0xeb53('0x13')]('isVisible',_0x41525a);}get[_0xeb53('0x5')](){return _0xeb53('0x1c')==typeof this[_0xeb53('0x11')]?this[_0xeb53('0x11')]():this[_0xeb53('0x11')];}get[_0xeb53('0x1e')](){return this['view'][_0xeb53('0x16')];}get[_0xeb53('0x10')](){const _0x155b10=this[_0xeb53('0x20')]();return d[_0xeb53('0x6')](_0x155b10),_0x155b10;}get[_0xeb53('0x8')](){const _0x437047=this[_0xeb53('0x10')];if(null===_0x437047)return null;if(_0x437047 instanceof _0x4249d2)return _0x437047;const _0x27e743=_0x437047[_0xeb53('0xc')](_0x3d07c5=>function(_0x349402){const _0x465357=_0x349402[_0xeb53('0xa')];if(_0x465357)return!0x0;const _0x31770a=_0x349402[_0xeb53('0x1')]()[_0xeb53('0x1a')](0x0);return!!_0x31770a;}(_0x3d07c5));return 0x0===_0x27e743['length']?null:new _0x4249d2(_0x27e743[0x0][_0xeb53('0x1')]()['item'](0x0));}get[_0xeb53('0x2')](){return this[_0xeb53('0x3')][_0xeb53('0x2')];}set[_0xeb53('0x2')](_0x425af3){this['view'][_0xeb53('0x2')]=_0x425af3,this['view'][_0xeb53('0x16')][_0xeb53('0x2')]=_0x425af3;}[_0xeb53('0x14')](){this[_0xeb53('0x3')]['targetRect']=this[_0xeb53('0x8')];}[_0xeb53('0x19')](){this[_0xeb53('0xb')][_0xeb53('0xf')](),this[_0xeb53('0xb')][_0xeb53('0x15')](),this['stopListening']();}[_0xeb53('0xe')](){this[_0xeb53('0x1b')]=!!this[_0xeb53('0x8')];}static[_0xeb53('0x6')](_0x16c7a9){if(!(null===_0x16c7a9||_0x16c7a9 instanceof _0x4249d2||Array[_0xeb53('0xd')](_0x16c7a9)&&_0x16c7a9[_0xeb53('0x4')](_0x2463bf=>y(_0x2463bf))))throw new _0x3e2b60(_0xeb53('0x12'),null,{'target':_0x16c7a9});}[_0xeb53('0x20')](){const _0x531f04=_0xeb53('0x1c')==typeof this[_0xeb53('0x17')]?this[_0xeb53('0x17')]():this[_0xeb53('0x17')];return y(_0x531f04)?[_0x531f04]:_0x531f04;}}function y(_0x446bbf){return null!==_0x446bbf&&_0xeb53('0x7')==typeof _0x446bbf&&'nodeType'in _0x446bbf&&0x1===_0x446bbf['nodeType'];}
@@ -1,94 +1,94 @@
1
- /**
2
- * @module comments/annotations/annotationcollection
3
- * @publicApi
4
- */
5
- import { Collection } from 'ckeditor5/src/utils';
6
- import type { View } from 'ckeditor5/src/ui';
7
- import type Annotation from './annotation';
8
- /**
9
- * A collection of {@link module:comments/annotations/annotation~Annotation annotations}.
10
- *
11
- * It implements methods for managing annotations and creates a focus tracker for them to make it easier to manage
12
- * the focus for all annotations.
13
- *
14
- * `AnnotationCollection` fires {@link module:comments/annotations/annotationcollection~AnnotationCollection#event:focus} when an annotation
15
- * becomes focused and {@link module:comments/annotations/annotationcollection~AnnotationCollection#event:blur} when all annotations
16
- * lose focus.
17
- */
18
- export default class AnnotationCollection extends Collection<Annotation> {
19
- /**
20
- * @param annotations Initial annotations.
21
- */
22
- constructor(annotations?: Iterable<Annotation>);
23
- /**
24
- * Equals to `true` when one of the annotation in the collection is focused.
25
- */
26
- get isFocused(): boolean;
27
- /**
28
- * Adds an annotation to the collection.
29
- */
30
- add(annotation: Annotation): this;
31
- /**
32
- * Removes the annotation from the collection.
33
- */
34
- remove(annotation: Annotation): Annotation;
35
- /**
36
- * Gets the annotation for a given annotation view's inner view.
37
- */
38
- getByInnerView(innerView: View): Annotation | undefined;
39
- /**
40
- * Gets the annotation for a given annotation view.
41
- */
42
- getByView(view: View): Annotation | undefined;
43
- /**
44
- * Destroys all bindings and clears the collection.
45
- */
46
- destroy(): void;
47
- /**
48
- * Refreshes the positioning of all annotations and sorts them topmost and leftmost.
49
- */
50
- refreshPositioning(): void;
51
- }
52
- /**
53
- * Fired when an annotation becomes active.
54
- *
55
- * @eventName ~AnnotationCollection#focus
56
- * @param annotation An annotation that was focused.
57
- */
58
- export type AnnotationFocusEvent = {
59
- name: 'focus';
60
- args: [annotation: Annotation];
61
- };
62
- /**
63
- * Fired when all annotations become blurred.
64
- *
65
- * @eventName ~AnnotationCollection#blur
66
- */
67
- export type AnnotationBlurEvent = {
68
- name: 'blur';
69
- args: [];
70
- };
71
- /**
72
- * A helper function that binds two {@link module:comments/annotations/annotationcollection~AnnotationCollection AnnotationCollection}s
73
- * and allows filtering items based on the passed callback.
74
- *
75
- * Since {@link module:comments/annotations/annotationcollection~AnnotationCollection#refreshPositioning}
76
- * sorts the annotations by removing and inserting items, the binding implemented by the `bindTo()` method is lost. This is why
77
- * this helper needs to be used.
78
- *
79
- * This helper is used by the annotations UIs to filter which annotations from the
80
- * {@link module:comments/annotations/annotations~Annotations#collection main annotation collection} should be handled by
81
- * a given annotations UI.
82
- *
83
- * @param `options.source` The source collection
84
- * from which the annotations will be taken.
85
- * @param `options.target` The target collection
86
- * that will be synced to the source collection.
87
- * @param options.filter Filtering function that gets an annotation and should return `true` if the annotation should be
88
- * copied to the `target` collection.
89
- */
90
- export declare function bindAnnotationCollections({ source, target, filter }: {
91
- source: AnnotationCollection;
92
- target: AnnotationCollection;
93
- filter: (annotation: Annotation) => boolean;
94
- }): void;
1
+ /**
2
+ * @module comments/annotations/annotationcollection
3
+ * @publicApi
4
+ */
5
+ import { Collection } from 'ckeditor5/src/utils';
6
+ import type { View } from 'ckeditor5/src/ui';
7
+ import type Annotation from './annotation';
8
+ /**
9
+ * A collection of {@link module:comments/annotations/annotation~Annotation annotations}.
10
+ *
11
+ * It implements methods for managing annotations and creates a focus tracker for them to make it easier to manage
12
+ * the focus for all annotations.
13
+ *
14
+ * `AnnotationCollection` fires {@link module:comments/annotations/annotationcollection~AnnotationCollection#event:focus} when an annotation
15
+ * becomes focused and {@link module:comments/annotations/annotationcollection~AnnotationCollection#event:blur} when all annotations
16
+ * lose focus.
17
+ */
18
+ export default class AnnotationCollection extends Collection<Annotation> {
19
+ /**
20
+ * @param annotations Initial annotations.
21
+ */
22
+ constructor(annotations?: Iterable<Annotation>);
23
+ /**
24
+ * Equals to `true` when one of the annotation in the collection is focused.
25
+ */
26
+ get isFocused(): boolean;
27
+ /**
28
+ * Adds an annotation to the collection.
29
+ */
30
+ add(annotation: Annotation): this;
31
+ /**
32
+ * Removes the annotation from the collection.
33
+ */
34
+ remove(annotation: Annotation): Annotation;
35
+ /**
36
+ * Gets the annotation for a given annotation view's inner view.
37
+ */
38
+ getByInnerView(innerView: View): Annotation | undefined;
39
+ /**
40
+ * Gets the annotation for a given annotation view.
41
+ */
42
+ getByView(view: View): Annotation | undefined;
43
+ /**
44
+ * Destroys all bindings and clears the collection.
45
+ */
46
+ destroy(): void;
47
+ /**
48
+ * Refreshes the positioning of all annotations and sorts them topmost and leftmost.
49
+ */
50
+ refreshPositioning(): void;
51
+ }
52
+ /**
53
+ * Fired when an annotation becomes active.
54
+ *
55
+ * @eventName ~AnnotationCollection#focus
56
+ * @param annotation An annotation that was focused.
57
+ */
58
+ export type AnnotationFocusEvent = {
59
+ name: 'focus';
60
+ args: [annotation: Annotation];
61
+ };
62
+ /**
63
+ * Fired when all annotations become blurred.
64
+ *
65
+ * @eventName ~AnnotationCollection#blur
66
+ */
67
+ export type AnnotationBlurEvent = {
68
+ name: 'blur';
69
+ args: [];
70
+ };
71
+ /**
72
+ * A helper function that binds two {@link module:comments/annotations/annotationcollection~AnnotationCollection AnnotationCollection}s
73
+ * and allows filtering items based on the passed callback.
74
+ *
75
+ * Since {@link module:comments/annotations/annotationcollection~AnnotationCollection#refreshPositioning}
76
+ * sorts the annotations by removing and inserting items, the binding implemented by the `bindTo()` method is lost. This is why
77
+ * this helper needs to be used.
78
+ *
79
+ * This helper is used by the annotations UIs to filter which annotations from the
80
+ * {@link module:comments/annotations/annotations~Annotations#collection main annotation collection} should be handled by
81
+ * a given annotations UI.
82
+ *
83
+ * @param `options.source` The source collection
84
+ * from which the annotations will be taken.
85
+ * @param `options.target` The target collection
86
+ * that will be synced to the source collection.
87
+ * @param options.filter Filtering function that gets an annotation and should return `true` if the annotation should be
88
+ * copied to the `target` collection.
89
+ */
90
+ export declare function bindAnnotationCollections({ source, target, filter }: {
91
+ source: AnnotationCollection;
92
+ target: AnnotationCollection;
93
+ filter: (annotation: Annotation) => boolean;
94
+ }): void;
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x3f61=['change:isFocused','_getOrderInContent','getByInnerView','focusTracker','add','delete','_innerViewToAnnotation','focusableElements','_viewToAnnotation','has','clear','set','listenTo','updateTargetRect','remove','annotationcollection-not-existing-item','annotationcollection-duplicated-item','length','isFocused','focus','stopListening','_sort','sort','top','blur','get','left','targetRect','_focusTracker','view'];(function(_0x456261,_0x3f615e){const _0x5b07f6=function(_0x2c62e5){while(--_0x2c62e5){_0x456261['push'](_0x456261['shift']());}};_0x5b07f6(++_0x3f615e);}(_0x3f61,0x187));const _0x5b07=function(_0x456261,_0x3f615e){_0x456261=_0x456261-0x0;let _0x5b07f6=_0x3f61[_0x456261];return _0x5b07f6;};import{CKEditorError as _0x4527de,Collection as _0x320652,FocusTracker as _0xe0323d}from'ckeditor5/src/utils';export default class x extends _0x320652{constructor(_0x22d127=[]){super(),this[_0x5b07('0x5')]=new Map(),this[_0x5b07('0x7')]=new Map(),this['_focusTracker']=new _0xe0323d(),this[_0x5b07('0x1b')]['on'](_0x5b07('0x1d'),(_0x516174,_0x4fd536,_0x3167f9)=>{_0x3167f9||this['fire'](_0x5b07('0x17'));});for(const _0x664003 of _0x22d127)this[_0x5b07('0x3')](_0x664003);}get[_0x5b07('0x11')](){return this[_0x5b07('0x1b')]['isFocused'];}['add'](_0x298b10){if(this[_0x5b07('0x8')](_0x298b10))throw new _0x4527de(_0x5b07('0xf'),null);this['_innerViewToAnnotation'][_0x5b07('0xa')](_0x298b10['innerView'],_0x298b10),this[_0x5b07('0x7')][_0x5b07('0xa')](_0x298b10[_0x5b07('0x1c')],_0x298b10);for(const _0x480fc0 of _0x298b10['focusableElements'])this[_0x5b07('0x1b')][_0x5b07('0x3')](_0x480fc0);this[_0x5b07('0xb')](_0x298b10[_0x5b07('0x6')],_0x5b07('0x3'),(_0x421717,_0x37e18a)=>{this[_0x5b07('0x1b')]['add'](_0x37e18a);}),this[_0x5b07('0xb')](_0x298b10[_0x5b07('0x6')],_0x5b07('0xd'),(_0xc87293,_0x5eb134)=>{this[_0x5b07('0x1b')]['remove'](_0x5eb134);}),this['listenTo'](_0x298b10[_0x5b07('0x1c')][_0x5b07('0x2')],_0x5b07('0x1d'),(_0x146b9c,_0x1dadb1,_0x4560cd)=>{_0x4560cd&&this['fire'](_0x5b07('0x12'),_0x298b10);}),_0x298b10[_0x5b07('0xc')]();const _0x4e36f7=this[_0x5b07('0x0')](_0x298b10[_0x5b07('0x1c')]['targetRect']);return super[_0x5b07('0x3')](_0x298b10,_0x4e36f7);}['remove'](_0x1274ae){if(!this[_0x5b07('0x8')](_0x1274ae))throw new _0x4527de(_0x5b07('0xe'),null);this[_0x5b07('0x13')](_0x1274ae[_0x5b07('0x1c')][_0x5b07('0x2')]),this['stopListening'](_0x1274ae[_0x5b07('0x6')]);for(const _0x23ec91 of _0x1274ae[_0x5b07('0x6')])this[_0x5b07('0x1b')][_0x5b07('0xd')](_0x23ec91);return this['_viewToAnnotation'][_0x5b07('0x4')](_0x1274ae[_0x5b07('0x1c')]),this['_innerViewToAnnotation'][_0x5b07('0x4')](_0x1274ae['innerView']),super[_0x5b07('0xd')](_0x1274ae);}[_0x5b07('0x1')](_0xe697fe){return this['_innerViewToAnnotation'][_0x5b07('0x18')](_0xe697fe);}['getByView'](_0x3d8be9){return this[_0x5b07('0x7')][_0x5b07('0x18')](_0x3d8be9);}['destroy'](){super[_0x5b07('0x9')](),this[_0x5b07('0x13')](),this[_0x5b07('0x5')][_0x5b07('0x9')](),this[_0x5b07('0x7')]['clear'](),this[_0x5b07('0x1b')]['destroy']();}['refreshPositioning'](){for(const _0x153265 of this)_0x153265['updateTargetRect']();this['_sort']();}[_0x5b07('0x14')](){const _0x3fbc4d=Array['from'](this)[_0x5b07('0x15')]((_0x4242c0,_0x2a8dbc)=>v(_0x4242c0[_0x5b07('0x1c')][_0x5b07('0x1a')],_0x2a8dbc['view'][_0x5b07('0x1a')]));for(let _0x543ac9=_0x3fbc4d[_0x5b07('0x10')]-0x1;_0x543ac9>0x0;_0x543ac9--){const _0x2fa871=_0x3fbc4d[_0x543ac9];_0x543ac9!==this['getIndex'](_0x2fa871)&&(this[_0x5b07('0xd')](_0x2fa871),this[_0x5b07('0x3')](_0x2fa871));}}[_0x5b07('0x0')](_0x53af32){let _0x531b64=0x0;if(!_0x53af32)return this[_0x5b07('0x10')];for(const _0x133aed of this){const _0x353d02=_0x133aed[_0x5b07('0x1c')][_0x5b07('0x1a')];if(_0x353d02){if(v(_0x53af32,_0x353d02)<0x0)return _0x531b64;_0x531b64++;}}return _0x531b64;}}export function bindAnnotationCollections({source:_0x59fdc6,target:_0x43d254,filter:_0x8715f}){for(const _0x2d2da7 of _0x59fdc6)_0x8715f(_0x2d2da7)&&_0x43d254['add'](_0x2d2da7);_0x43d254[_0x5b07('0xb')](_0x59fdc6,_0x5b07('0x3'),(_0x39fded,_0x183034)=>{_0x8715f(_0x183034)&&_0x43d254[_0x5b07('0x3')](_0x183034);}),_0x43d254[_0x5b07('0xb')](_0x59fdc6,'remove',(_0x2b9ca4,_0x3f91d1)=>{_0x43d254['has'](_0x3f91d1)&&_0x43d254[_0x5b07('0xd')](_0x3f91d1);});}function v(_0x4946d3,_0x4e7714){if(null===_0x4946d3&&null===_0x4e7714)return 0x0;if(null===_0x4946d3)return-0x1;if(null===_0x4e7714)return 0x1;const _0x49e40d=_0x4946d3[_0x5b07('0x16')]-_0x4e7714[_0x5b07('0x16')];return 0x0==_0x49e40d?_0x4946d3[_0x5b07('0x19')]-_0x4e7714['left']:_0x49e40d;}
23
+ const _0x32ea=['_getOrderInContent','_innerViewToAnnotation','remove','top','isFocused','fire','annotationcollection-not-existing-item','targetRect','destroy','blur','has','updateTargetRect','length','clear','getIndex','delete','getByInnerView','_sort','focusableElements','refreshPositioning','annotationcollection-duplicated-item','left','focusTracker','set','get','sort','view','from','innerView','listenTo','add','change:isFocused','_viewToAnnotation','stopListening','focus','_focusTracker','getByView'];(function(_0x124e3b,_0x32ea64){const _0x310ff0=function(_0x37bc59){while(--_0x37bc59){_0x124e3b['push'](_0x124e3b['shift']());}};_0x310ff0(++_0x32ea64);}(_0x32ea,0xb0));const _0x310f=function(_0x124e3b,_0x32ea64){_0x124e3b=_0x124e3b-0x0;let _0x310ff0=_0x32ea[_0x124e3b];return _0x310ff0;};import{CKEditorError as _0x5a6e77,Collection as _0x22193f,FocusTracker as _0x43fefe}from'ckeditor5/src/utils';export default class x extends _0x22193f{constructor(_0x3e3c73=[]){super(),this[_0x310f('0xa')]=new Map(),this[_0x310f('0x4')]=new Map(),this[_0x310f('0x7')]=new _0x43fefe(),this[_0x310f('0x7')]['on'](_0x310f('0x3'),(_0x388767,_0x57319f,_0x4b0f0f)=>{_0x4b0f0f||this[_0x310f('0xe')](_0x310f('0x12'));});for(const _0x3dfe11 of _0x3e3c73)this[_0x310f('0x2')](_0x3dfe11);}get[_0x310f('0xd')](){return this[_0x310f('0x7')][_0x310f('0xd')];}[_0x310f('0x2')](_0x40c375){if(this[_0x310f('0x13')](_0x40c375))throw new _0x5a6e77(_0x310f('0x1d'),null);this[_0x310f('0xa')][_0x310f('0x20')](_0x40c375[_0x310f('0x0')],_0x40c375),this[_0x310f('0x4')][_0x310f('0x20')](_0x40c375[_0x310f('0x23')],_0x40c375);for(const _0x2b4983 of _0x40c375[_0x310f('0x1b')])this[_0x310f('0x7')]['add'](_0x2b4983);this[_0x310f('0x1')](_0x40c375[_0x310f('0x1b')],'add',(_0x43995c,_0x3976d5)=>{this['_focusTracker'][_0x310f('0x2')](_0x3976d5);}),this[_0x310f('0x1')](_0x40c375[_0x310f('0x1b')],_0x310f('0xb'),(_0x1489d8,_0x494b9c)=>{this['_focusTracker'][_0x310f('0xb')](_0x494b9c);}),this[_0x310f('0x1')](_0x40c375[_0x310f('0x23')][_0x310f('0x1f')],_0x310f('0x3'),(_0x9fe4bf,_0x2aeedc,_0x21510c)=>{_0x21510c&&this[_0x310f('0xe')](_0x310f('0x6'),_0x40c375);}),_0x40c375[_0x310f('0x14')]();const _0x575fb6=this[_0x310f('0x9')](_0x40c375[_0x310f('0x23')][_0x310f('0x10')]);return super[_0x310f('0x2')](_0x40c375,_0x575fb6);}[_0x310f('0xb')](_0x8ebe37){if(!this[_0x310f('0x13')](_0x8ebe37))throw new _0x5a6e77(_0x310f('0xf'),null);this[_0x310f('0x5')](_0x8ebe37['view'][_0x310f('0x1f')]),this[_0x310f('0x5')](_0x8ebe37[_0x310f('0x1b')]);for(const _0x412990 of _0x8ebe37['focusableElements'])this[_0x310f('0x7')][_0x310f('0xb')](_0x412990);return this[_0x310f('0x4')][_0x310f('0x18')](_0x8ebe37[_0x310f('0x23')]),this[_0x310f('0xa')][_0x310f('0x18')](_0x8ebe37[_0x310f('0x0')]),super[_0x310f('0xb')](_0x8ebe37);}[_0x310f('0x19')](_0x223d1a){return this[_0x310f('0xa')][_0x310f('0x21')](_0x223d1a);}[_0x310f('0x8')](_0x2bd6a){return this[_0x310f('0x4')]['get'](_0x2bd6a);}[_0x310f('0x11')](){super[_0x310f('0x16')](),this[_0x310f('0x5')](),this[_0x310f('0xa')][_0x310f('0x16')](),this['_viewToAnnotation'][_0x310f('0x16')](),this[_0x310f('0x7')]['destroy']();}[_0x310f('0x1c')](){for(const _0x3de194 of this)_0x3de194[_0x310f('0x14')]();this[_0x310f('0x1a')]();}[_0x310f('0x1a')](){const _0x4a79b3=Array[_0x310f('0x24')](this)[_0x310f('0x22')]((_0x356082,_0x1e6338)=>v(_0x356082[_0x310f('0x23')][_0x310f('0x10')],_0x1e6338[_0x310f('0x23')]['targetRect']));for(let _0x19d0e8=_0x4a79b3[_0x310f('0x15')]-0x1;_0x19d0e8>0x0;_0x19d0e8--){const _0x433bbc=_0x4a79b3[_0x19d0e8];_0x19d0e8!==this[_0x310f('0x17')](_0x433bbc)&&(this['remove'](_0x433bbc),this['add'](_0x433bbc));}}['_getOrderInContent'](_0x3d8f63){let _0x34a625=0x0;if(!_0x3d8f63)return this[_0x310f('0x15')];for(const _0x4452a8 of this){const _0x47b833=_0x4452a8[_0x310f('0x23')]['targetRect'];if(_0x47b833){if(v(_0x3d8f63,_0x47b833)<0x0)return _0x34a625;_0x34a625++;}}return _0x34a625;}}export function bindAnnotationCollections({source:_0x7ed3f,target:_0x2b705a,filter:_0x53b583}){for(const _0x2a7988 of _0x7ed3f)_0x53b583(_0x2a7988)&&_0x2b705a['add'](_0x2a7988);_0x2b705a[_0x310f('0x1')](_0x7ed3f,_0x310f('0x2'),(_0x1276c4,_0x4c1cef)=>{_0x53b583(_0x4c1cef)&&_0x2b705a[_0x310f('0x2')](_0x4c1cef);}),_0x2b705a['listenTo'](_0x7ed3f,_0x310f('0xb'),(_0x11cff3,_0x59e1f3)=>{_0x2b705a['has'](_0x59e1f3)&&_0x2b705a[_0x310f('0xb')](_0x59e1f3);});}function v(_0x1aae34,_0x144936){if(null===_0x1aae34&&null===_0x144936)return 0x0;if(null===_0x1aae34)return-0x1;if(null===_0x144936)return 0x1;const _0x12c845=_0x1aae34[_0x310f('0xc')]-_0x144936[_0x310f('0xc')];return 0x0==_0x12c845?_0x1aae34[_0x310f('0x1e')]-_0x144936['left']:_0x12c845;}