@ckeditor/ckeditor5-comments 38.1.1 → 38.2.0-alpha.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 (86) hide show
  1. package/build/comments.js +1 -1
  2. package/package.json +4 -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/index.js +1 -1
  83. package/src/utils/common-translations.d.ts +5 -5
  84. package/src/utils/common-translations.js +1 -1
  85. package/src/utils/createmutationobserver.d.ts +13 -13
  86. 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.1",
3
+ "version": "38.2.0-alpha.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/)",
@@ -33,6 +33,7 @@
33
33
  "discussions"
34
34
  ],
35
35
  "main": "src/index.js",
36
+ "type": "module",
36
37
  "files": [
37
38
  "build",
38
39
  "lang",
@@ -43,8 +44,8 @@
43
44
  "CHANGELOG.md"
44
45
  ],
45
46
  "dependencies": {
46
- "ckeditor5": "38.1.1",
47
- "ckeditor5-collaboration": "38.1.1",
47
+ "ckeditor5": "38.2.0-alpha.1",
48
+ "ckeditor5-collaboration": "38.2.0-alpha.1",
48
49
  "lodash-es": "^4.17.11"
49
50
  },
50
51
  "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.js';
6
+ import type { View } from 'ckeditor5/src/ui.js';
7
+ import type AnnotationView from './view/annotationview.js';
8
+ import type { AnnotationOptions } from './annotations.js';
9
+ declare const Annotation_base: {
10
+ new (): import("ckeditor5/src/utils.js").Observable;
11
+ prototype: import("ckeditor5/src/utils.js").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 _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'];}
23
+ const _0x7d4a=['annotation-invalid-target','view','set','focusableElements','add','every','filter','destroy','targetRect','isArray','remove','function','_getNormalizedTarget','_type','refreshVisibility','render','target','item','mainView','_target','_assertCorrectTarget','isActive','stopListening','focusTracker','nodeType','offsetParent','isVisible','innerView'];(function(_0x504d8a,_0x7d4a06){const _0x59dd62=function(_0x3e80b2){while(--_0x3e80b2){_0x504d8a['push'](_0x504d8a['shift']());}};_0x59dd62(++_0x7d4a06);}(_0x7d4a,0x1b5));const _0x59dd=function(_0x504d8a,_0x7d4a06){_0x504d8a=_0x504d8a-0x0;let _0x59dd62=_0x7d4a[_0x504d8a];return _0x59dd62;};import{CKEditorError as _0xa45750,Rect as _0x3e2b36,Collection as _0x2ad174,ObservableMixin as _0x3bb101}from'ckeditor5/src/utils.js';export default class d extends _0x3bb101(){constructor({view:_0x211616,target:_0x31ce7f,type:_0x3e88d7,isVisible:_0x18d2f4=!0x0}){super(),this[_0x59dd('0xc')]=_0x211616,this[_0x59dd('0xc')]['element']||this['view'][_0x59dd('0x1a')](),this[_0x59dd('0x18')]=_0x3e88d7,this[_0x59dd('0x2')]=_0x31ce7f,d['_assertCorrectTarget'](this[_0x59dd('0x17')]()),this[_0x59dd('0xe')]=new _0x2ad174([this[_0x59dd('0xc')]['element']],{'idProperty':'_id'}),this['focusableElements']['on'](_0x59dd('0xf'),(_0x8d3004,_0x379474)=>{this[_0x59dd('0xc')]['focusTracker'][_0x59dd('0xf')](_0x379474);}),this[_0x59dd('0xe')]['on'](_0x59dd('0x15'),(_0x53b9fc,_0x46c2e0)=>{this[_0x59dd('0xc')][_0x59dd('0x6')]['remove'](_0x46c2e0);}),this[_0x59dd('0xd')](_0x59dd('0x9'),_0x18d2f4);}get['type'](){return _0x59dd('0x16')==typeof this[_0x59dd('0x18')]?this[_0x59dd('0x18')]():this[_0x59dd('0x18')];}get[_0x59dd('0xa')](){return this[_0x59dd('0xc')][_0x59dd('0x1')];}get[_0x59dd('0x1b')](){const _0x517248=this[_0x59dd('0x17')]();return d[_0x59dd('0x3')](_0x517248),_0x517248;}get['targetRect'](){const _0x435a17=this['target'];if(null===_0x435a17)return null;if(_0x435a17 instanceof _0x3e2b36)return _0x435a17;const _0x3d6dfc=_0x435a17[_0x59dd('0x11')](_0x32bea4=>function(_0x48449f){const _0xbc8711=_0x48449f[_0x59dd('0x8')];if(_0xbc8711)return!0x0;const _0x1f9c8e=_0x48449f['getClientRects']()['item'](0x0);return!!_0x1f9c8e;}(_0x32bea4));return 0x0===_0x3d6dfc['length']?null:new _0x3e2b36(_0x3d6dfc[0x0]['getClientRects']()[_0x59dd('0x0')](0x0));}get['isActive'](){return this[_0x59dd('0xc')]['isActive'];}set[_0x59dd('0x4')](_0x7bc304){this[_0x59dd('0xc')][_0x59dd('0x4')]=_0x7bc304,this[_0x59dd('0xc')][_0x59dd('0x1')][_0x59dd('0x4')]=_0x7bc304;}['updateTargetRect'](){this[_0x59dd('0xc')][_0x59dd('0x13')]=this[_0x59dd('0x13')];}[_0x59dd('0x12')](){this[_0x59dd('0xe')]['stopListening'](),this['focusableElements']['clear'](),this[_0x59dd('0x5')]();}[_0x59dd('0x19')](){this[_0x59dd('0x9')]=!!this[_0x59dd('0x13')];}static[_0x59dd('0x3')](_0x1ce8f7){if(!(null===_0x1ce8f7||_0x1ce8f7 instanceof _0x3e2b36||Array[_0x59dd('0x14')](_0x1ce8f7)&&_0x1ce8f7[_0x59dd('0x10')](_0x579a58=>y(_0x579a58))))throw new _0xa45750(_0x59dd('0xb'),null,{'target':_0x1ce8f7});}['_getNormalizedTarget'](){const _0x5861b5=_0x59dd('0x16')==typeof this['_target']?this[_0x59dd('0x2')]():this[_0x59dd('0x2')];return y(_0x5861b5)?[_0x5861b5]:_0x5861b5;}}function y(_0x414a91){return null!==_0x414a91&&'object'==typeof _0x414a91&&_0x59dd('0x7')in _0x414a91&&0x1===_0x414a91['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.js';
6
+ import type { View } from 'ckeditor5/src/ui.js';
7
+ import type Annotation from './annotation.js';
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 _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;}
23
+ const _0x101e=['updateTargetRect','_focusTracker','destroy','fire','getByInnerView','view','left','getByView','_innerViewToAnnotation','change:isFocused','add','annotationcollection-duplicated-item','innerView','isFocused','annotationcollection-not-existing-item','focusTracker','getIndex','from','_sort','listenTo','set','get','_viewToAnnotation','_getOrderInContent','has','sort','clear','remove','focusableElements','targetRect','top','stopListening','length','delete','blur'];(function(_0x55457a,_0x101e05){const _0xe04e4b=function(_0x4ef2da){while(--_0x4ef2da){_0x55457a['push'](_0x55457a['shift']());}};_0xe04e4b(++_0x101e05);}(_0x101e,0x1ca));const _0xe04e=function(_0x55457a,_0x101e05){_0x55457a=_0x55457a-0x0;let _0xe04e4b=_0x101e[_0x55457a];return _0xe04e4b;};import{CKEditorError as _0xaa3ab7,Collection as _0x26cb33,FocusTracker as _0x339725}from'ckeditor5/src/utils.js';export default class x extends _0x26cb33{constructor(_0x2a8091=[]){super(),this['_innerViewToAnnotation']=new Map(),this[_0xe04e('0x13')]=new Map(),this['_focusTracker']=new _0x339725(),this['_focusTracker']['on'](_0xe04e('0x6'),(_0x1becd6,_0x3e48f4,_0x5f2210)=>{_0x5f2210||this['fire'](_0xe04e('0x1f'));});for(const _0xf3be07 of _0x2a8091)this[_0xe04e('0x7')](_0xf3be07);}get[_0xe04e('0xa')](){return this[_0xe04e('0x21')][_0xe04e('0xa')];}[_0xe04e('0x7')](_0xa4d2c6){if(this['has'](_0xa4d2c6))throw new _0xaa3ab7(_0xe04e('0x8'),null);this[_0xe04e('0x5')]['set'](_0xa4d2c6[_0xe04e('0x9')],_0xa4d2c6),this[_0xe04e('0x13')][_0xe04e('0x11')](_0xa4d2c6[_0xe04e('0x2')],_0xa4d2c6);for(const _0x97943 of _0xa4d2c6[_0xe04e('0x19')])this['_focusTracker'][_0xe04e('0x7')](_0x97943);this['listenTo'](_0xa4d2c6[_0xe04e('0x19')],_0xe04e('0x7'),(_0x3264a8,_0x198f96)=>{this[_0xe04e('0x21')]['add'](_0x198f96);}),this[_0xe04e('0x10')](_0xa4d2c6['focusableElements'],_0xe04e('0x18'),(_0xf11a48,_0x2d9520)=>{this[_0xe04e('0x21')][_0xe04e('0x18')](_0x2d9520);}),this[_0xe04e('0x10')](_0xa4d2c6[_0xe04e('0x2')][_0xe04e('0xc')],_0xe04e('0x6'),(_0x11b79f,_0x5235b2,_0xcb138f)=>{_0xcb138f&&this[_0xe04e('0x0')]('focus',_0xa4d2c6);}),_0xa4d2c6[_0xe04e('0x20')]();const _0x201d93=this[_0xe04e('0x14')](_0xa4d2c6[_0xe04e('0x2')]['targetRect']);return super['add'](_0xa4d2c6,_0x201d93);}[_0xe04e('0x18')](_0x3863dd){if(!this[_0xe04e('0x15')](_0x3863dd))throw new _0xaa3ab7(_0xe04e('0xb'),null);this[_0xe04e('0x1c')](_0x3863dd[_0xe04e('0x2')]['focusTracker']),this['stopListening'](_0x3863dd[_0xe04e('0x19')]);for(const _0x587c04 of _0x3863dd[_0xe04e('0x19')])this[_0xe04e('0x21')]['remove'](_0x587c04);return this[_0xe04e('0x13')][_0xe04e('0x1e')](_0x3863dd[_0xe04e('0x2')]),this[_0xe04e('0x5')][_0xe04e('0x1e')](_0x3863dd[_0xe04e('0x9')]),super[_0xe04e('0x18')](_0x3863dd);}[_0xe04e('0x1')](_0x5ebfa5){return this[_0xe04e('0x5')][_0xe04e('0x12')](_0x5ebfa5);}[_0xe04e('0x4')](_0x423c58){return this['_viewToAnnotation'][_0xe04e('0x12')](_0x423c58);}[_0xe04e('0x22')](){super[_0xe04e('0x17')](),this['stopListening'](),this['_innerViewToAnnotation'][_0xe04e('0x17')](),this[_0xe04e('0x13')][_0xe04e('0x17')](),this[_0xe04e('0x21')]['destroy']();}['refreshPositioning'](){for(const _0x4b0c06 of this)_0x4b0c06[_0xe04e('0x20')]();this[_0xe04e('0xf')]();}[_0xe04e('0xf')](){const _0x204071=Array[_0xe04e('0xe')](this)[_0xe04e('0x16')]((_0x17510a,_0x39a16d)=>v(_0x17510a[_0xe04e('0x2')][_0xe04e('0x1a')],_0x39a16d[_0xe04e('0x2')][_0xe04e('0x1a')]));for(let _0x520d0b=_0x204071['length']-0x1;_0x520d0b>0x0;_0x520d0b--){const _0x353a44=_0x204071[_0x520d0b];_0x520d0b!==this[_0xe04e('0xd')](_0x353a44)&&(this['remove'](_0x353a44),this[_0xe04e('0x7')](_0x353a44));}}['_getOrderInContent'](_0xb2d1f2){let _0x114243=0x0;if(!_0xb2d1f2)return this[_0xe04e('0x1d')];for(const _0xbea4fc of this){const _0x57026c=_0xbea4fc[_0xe04e('0x2')][_0xe04e('0x1a')];if(_0x57026c){if(v(_0xb2d1f2,_0x57026c)<0x0)return _0x114243;_0x114243++;}}return _0x114243;}}export function bindAnnotationCollections({source:_0x5320d2,target:_0xc6a7c2,filter:_0x4dfe48}){for(const _0x25b9f1 of _0x5320d2)_0x4dfe48(_0x25b9f1)&&_0xc6a7c2[_0xe04e('0x7')](_0x25b9f1);_0xc6a7c2[_0xe04e('0x10')](_0x5320d2,_0xe04e('0x7'),(_0x5d529b,_0x5a94de)=>{_0x4dfe48(_0x5a94de)&&_0xc6a7c2[_0xe04e('0x7')](_0x5a94de);}),_0xc6a7c2['listenTo'](_0x5320d2,_0xe04e('0x18'),(_0x542d68,_0x1393ff)=>{_0xc6a7c2[_0xe04e('0x15')](_0x1393ff)&&_0xc6a7c2[_0xe04e('0x18')](_0x1393ff);});}function v(_0x347684,_0x3a99b7){if(null===_0x347684&&null===_0x3a99b7)return 0x0;if(null===_0x347684)return-0x1;if(null===_0x3a99b7)return 0x1;const _0x48d24f=_0x347684[_0xe04e('0x1b')]-_0x3a99b7[_0xe04e('0x1b')];return 0x0==_0x48d24f?_0x347684[_0xe04e('0x3')]-_0x3a99b7[_0xe04e('0x3')]:_0x48d24f;}