@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.
Files changed (157) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/LICENSE.md +6 -6
  3. package/README.md +14 -14
  4. package/build/comments.js +1 -1
  5. package/build/translations/fa.js +1 -1
  6. package/build/translations/pt-br.js +1 -1
  7. package/lang/translations/af.po +1 -0
  8. package/lang/translations/ar.po +1 -0
  9. package/lang/translations/bg.po +1 -0
  10. package/lang/translations/bn.po +1 -0
  11. package/lang/translations/bs.po +1 -0
  12. package/lang/translations/ca.po +1 -0
  13. package/lang/translations/cs.po +1 -0
  14. package/lang/translations/da.po +1 -0
  15. package/lang/translations/de-ch.po +1 -0
  16. package/lang/translations/de.po +1 -0
  17. package/lang/translations/el.po +1 -0
  18. package/lang/translations/en-au.po +1 -0
  19. package/lang/translations/en.po +1 -0
  20. package/lang/translations/es-co.po +1 -0
  21. package/lang/translations/es.po +1 -0
  22. package/lang/translations/et.po +1 -0
  23. package/lang/translations/fa.po +10 -9
  24. package/lang/translations/fi.po +1 -0
  25. package/lang/translations/fr.po +1 -0
  26. package/lang/translations/gl.po +1 -0
  27. package/lang/translations/he.po +1 -0
  28. package/lang/translations/hi.po +1 -0
  29. package/lang/translations/hr.po +1 -0
  30. package/lang/translations/hu.po +1 -0
  31. package/lang/translations/id.po +1 -0
  32. package/lang/translations/it.po +1 -0
  33. package/lang/translations/ja.po +1 -0
  34. package/lang/translations/jv.po +1 -0
  35. package/lang/translations/ko.po +1 -0
  36. package/lang/translations/lt.po +1 -0
  37. package/lang/translations/lv.po +1 -0
  38. package/lang/translations/ms.po +1 -0
  39. package/lang/translations/nl.po +1 -0
  40. package/lang/translations/no.po +1 -0
  41. package/lang/translations/pl.po +1 -0
  42. package/lang/translations/pt-br.po +4 -3
  43. package/lang/translations/pt.po +1 -0
  44. package/lang/translations/ro.po +1 -0
  45. package/lang/translations/ru.po +1 -0
  46. package/lang/translations/sk.po +1 -0
  47. package/lang/translations/sq.po +1 -0
  48. package/lang/translations/sr-latn.po +1 -0
  49. package/lang/translations/sr.po +1 -0
  50. package/lang/translations/sv.po +1 -0
  51. package/lang/translations/th.po +1 -0
  52. package/lang/translations/tk.po +1 -0
  53. package/lang/translations/tr.po +1 -0
  54. package/lang/translations/tt.po +1 -0
  55. package/lang/translations/ug.po +1 -0
  56. package/lang/translations/uk.po +1 -0
  57. package/lang/translations/ur.po +1 -0
  58. package/lang/translations/vi.po +1 -0
  59. package/lang/translations/zh-cn.po +1 -0
  60. package/lang/translations/zh.po +1 -0
  61. package/package.json +3 -7
  62. package/src/annotations/annotation.d.ts +90 -90
  63. package/src/annotations/annotation.js +1 -1
  64. package/src/annotations/annotationcollection.d.ts +98 -98
  65. package/src/annotations/annotationcollection.js +1 -1
  66. package/src/annotations/annotations.d.ts +154 -154
  67. package/src/annotations/annotations.js +1 -1
  68. package/src/annotations/annotationsuis.d.ts +232 -232
  69. package/src/annotations/annotationsuis.js +1 -1
  70. package/src/annotations/editorannotations.d.ts +67 -67
  71. package/src/annotations/editorannotations.js +1 -1
  72. package/src/annotations/inlineannotations.d.ts +90 -90
  73. package/src/annotations/inlineannotations.js +1 -1
  74. package/src/annotations/narrowsidebar.d.ts +85 -85
  75. package/src/annotations/narrowsidebar.js +1 -1
  76. package/src/annotations/sidebar.d.ts +100 -100
  77. package/src/annotations/sidebar.js +1 -1
  78. package/src/annotations/view/annotationcounterbuttonview.d.ts +29 -29
  79. package/src/annotations/view/annotationcounterbuttonview.js +1 -1
  80. package/src/annotations/view/annotationview.d.ts +90 -90
  81. package/src/annotations/view/annotationview.js +1 -1
  82. package/src/annotations/view/sidebaritemview.d.ts +55 -55
  83. package/src/annotations/view/sidebaritemview.js +1 -1
  84. package/src/annotations/view/sidebarview.d.ts +32 -32
  85. package/src/annotations/view/sidebarview.js +1 -1
  86. package/src/annotations/widesidebar.d.ts +77 -77
  87. package/src/annotations/widesidebar.js +1 -1
  88. package/src/augmentation.d.ts +52 -52
  89. package/src/comments/addcommentthreadcommand.d.ts +35 -35
  90. package/src/comments/addcommentthreadcommand.js +1 -1
  91. package/src/comments/commentsarchive.d.ts +31 -31
  92. package/src/comments/commentsarchive.js +1 -1
  93. package/src/comments/commentsarchiveui.d.ts +38 -38
  94. package/src/comments/commentsarchiveui.js +1 -1
  95. package/src/comments/commentsediting.d.ts +79 -79
  96. package/src/comments/commentsediting.js +1 -1
  97. package/src/comments/commentsrepository.d.ts +1129 -1105
  98. package/src/comments/commentsrepository.js +1 -1
  99. package/src/comments/commentsui.d.ts +33 -33
  100. package/src/comments/commentsui.js +1 -1
  101. package/src/comments/integrations/commentsrestrictededitingmode.d.ts +17 -17
  102. package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
  103. package/src/comments/integrations/importword.d.ts +21 -21
  104. package/src/comments/integrations/importword.js +1 -1
  105. package/src/comments/ui/commenteditor/commenteditor.d.ts +36 -36
  106. package/src/comments/ui/commenteditor/commenteditor.js +1 -1
  107. package/src/comments/ui/commenteditor/commenteditorui.d.ts +31 -31
  108. package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
  109. package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +36 -36
  110. package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
  111. package/src/comments/ui/commentthreadcontroller.d.ts +64 -64
  112. package/src/comments/ui/commentthreadcontroller.js +1 -1
  113. package/src/comments/ui/view/basecommentthreadview.d.ts +119 -112
  114. package/src/comments/ui/view/basecommentthreadview.js +1 -1
  115. package/src/comments/ui/view/basecommentview.d.ts +112 -112
  116. package/src/comments/ui/view/basecommentview.js +1 -1
  117. package/src/comments/ui/view/collapsedcommentsview.d.ts +13 -13
  118. package/src/comments/ui/view/collapsedcommentsview.js +1 -1
  119. package/src/comments/ui/view/commentcontentview.d.ts +14 -14
  120. package/src/comments/ui/view/commentcontentview.js +1 -1
  121. package/src/comments/ui/view/commentinputview.d.ts +86 -86
  122. package/src/comments/ui/view/commentinputview.js +1 -1
  123. package/src/comments/ui/view/commentsarchiveview.d.ts +38 -38
  124. package/src/comments/ui/view/commentsarchiveview.js +1 -1
  125. package/src/comments/ui/view/commentslistview.d.ts +100 -100
  126. package/src/comments/ui/view/commentslistview.js +1 -1
  127. package/src/comments/ui/view/commentthreadheaderview.d.ts +50 -50
  128. package/src/comments/ui/view/commentthreadheaderview.js +1 -1
  129. package/src/comments/ui/view/commentthreadinputview.d.ts +41 -41
  130. package/src/comments/ui/view/commentthreadinputview.js +1 -1
  131. package/src/comments/ui/view/commentthreadview.d.ts +118 -117
  132. package/src/comments/ui/view/commentthreadview.js +1 -1
  133. package/src/comments/ui/view/commentview.d.ts +243 -243
  134. package/src/comments/ui/view/commentview.js +1 -1
  135. package/src/comments.d.ts +35 -35
  136. package/src/comments.js +1 -1
  137. package/src/commentsonly.d.ts +33 -33
  138. package/src/commentsonly.js +1 -1
  139. package/src/config.d.ts +176 -176
  140. package/src/index.d.ts +24 -24
  141. package/src/utils/common-translations.d.ts +9 -9
  142. package/src/utils/common-translations.js +1 -1
  143. package/src/utils/createmutationobserver.d.ts +14 -14
  144. package/src/utils/createmutationobserver.js +1 -1
  145. package/theme/annotation-inline.css +2 -1
  146. package/theme/annotation.css +2 -3
  147. package/theme/comment.css +39 -38
  148. package/theme/commentinput.css +2 -1
  149. package/theme/commentmarker.css +7 -6
  150. package/theme/commentsarchive.css +2 -1
  151. package/theme/commentthread.css +68 -57
  152. package/theme/icons/add-comment.svg +1 -1
  153. package/theme/icons/comments-archive.svg +1 -1
  154. package/theme/icons/edit-comment.svg +1 -1
  155. package/theme/icons/remove-comment.svg +1 -1
  156. package/theme/sidebar-narrow.css +4 -3
  157. 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 _0x36d6=['refreshVisibility','targetRect','stopListening','view','_assertCorrectTarget','render','item','isVisible','length','isActive','nodeType','element','type','function','remove','focusTracker','focusableElements','_id','_target','annotation-invalid-target','target','_getNormalizedTarget','every','offsetParent','filter','mainView','add','_type','getClientRects'];(function(_0x2a0870,_0x36d6f2){const _0x494858=function(_0x5ad8f4){while(--_0x5ad8f4){_0x2a0870['push'](_0x2a0870['shift']());}};_0x494858(++_0x36d6f2);}(_0x36d6,0x114));const _0x4948=function(_0x2a0870,_0x36d6f2){_0x2a0870=_0x2a0870-0x0;let _0x494858=_0x36d6[_0x2a0870];return _0x494858;};import{CKEditorError as _0x302764,Rect as _0x59d830,Collection as _0x39193d,ObservableMixin as _0x1f988c}from'ckeditor5/src/utils';export default class d extends _0x1f988c(){constructor({view:_0x1c6efe,target:_0x39d939,type:_0x32d894,isVisible:_0x16c96e=!0x0}){super(),this[_0x4948('0x11')]=_0x1c6efe,this[_0x4948('0x11')][_0x4948('0x19')]||this['view'][_0x4948('0x13')](),this[_0x4948('0xc')]=_0x32d894,this[_0x4948('0x3')]=_0x39d939,d[_0x4948('0x12')](this[_0x4948('0x6')]()),this[_0x4948('0x1')]=new _0x39193d([this['view'][_0x4948('0x19')]],{'idProperty':_0x4948('0x2')}),this[_0x4948('0x1')]['on'](_0x4948('0xb'),(_0x2bc25f,_0x3b2b91)=>{this[_0x4948('0x11')][_0x4948('0x0')][_0x4948('0xb')](_0x3b2b91);}),this[_0x4948('0x1')]['on']('remove',(_0x166795,_0x1061ca)=>{this[_0x4948('0x11')][_0x4948('0x0')][_0x4948('0x1c')](_0x1061ca);}),this['set'](_0x4948('0x15'),_0x16c96e);}get[_0x4948('0x1a')](){return'function'==typeof this['_type']?this[_0x4948('0xc')]():this[_0x4948('0xc')];}get['innerView'](){return this[_0x4948('0x11')][_0x4948('0xa')];}get[_0x4948('0x5')](){const _0xda31d8=this['_getNormalizedTarget']();return d[_0x4948('0x12')](_0xda31d8),_0xda31d8;}get[_0x4948('0xf')](){const _0x57927f=this[_0x4948('0x5')];if(null===_0x57927f)return null;if(_0x57927f instanceof _0x59d830)return _0x57927f;const _0x48e3b9=_0x57927f[_0x4948('0x9')](_0x2424ac=>function(_0x331e58){const _0x206050=_0x331e58[_0x4948('0x8')];if(_0x206050)return!0x0;const _0x3cccbb=_0x331e58[_0x4948('0xd')]()[_0x4948('0x14')](0x0);return!!_0x3cccbb;}(_0x2424ac));return 0x0===_0x48e3b9[_0x4948('0x16')]?null:new _0x59d830(_0x48e3b9[0x0][_0x4948('0xd')]()[_0x4948('0x14')](0x0));}get[_0x4948('0x17')](){return this[_0x4948('0x11')][_0x4948('0x17')];}set[_0x4948('0x17')](_0x40d013){this[_0x4948('0x11')][_0x4948('0x17')]=_0x40d013,this[_0x4948('0x11')]['mainView']['isActive']=_0x40d013;}['updateTargetRect'](){this[_0x4948('0x11')][_0x4948('0xf')]=this['targetRect'];}['destroy'](){this[_0x4948('0x1')][_0x4948('0x10')](),this[_0x4948('0x1')]['clear'](),this[_0x4948('0x10')]();}[_0x4948('0xe')](){this[_0x4948('0x15')]=!!this['targetRect'];}static[_0x4948('0x12')](_0x2c9c21){if(!(null===_0x2c9c21||_0x2c9c21 instanceof _0x59d830||Array['isArray'](_0x2c9c21)&&_0x2c9c21[_0x4948('0x7')](_0x3c965f=>y(_0x3c965f))))throw new _0x302764(_0x4948('0x4'),null,{'target':_0x2c9c21});}[_0x4948('0x6')](){const _0x187840=_0x4948('0x1b')==typeof this['_target']?this[_0x4948('0x3')]():this[_0x4948('0x3')];return y(_0x187840)?[_0x187840]:_0x187840;}}function y(_0x30ac72){return null!==_0x30ac72&&'object'==typeof _0x30ac72&&_0x4948('0x18')in _0x30ac72&&0x1===_0x30ac72[_0x4948('0x18')];}
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 _0x3fe3=['from','getByView','view','getByInnerView','annotationcollection-duplicated-item','_innerViewToAnnotation','isFocused','focusTracker','stopListening','add','annotationcollection-not-existing-item','fire','focus','_sort','targetRect','change:isFocused','clear','remove','has','delete','destroy','set','length','focusableElements','get','_viewToAnnotation','_getOrderInContent','listenTo','getIndex','updateTargetRect','_focusTracker','innerView','left','top','sort'];(function(_0x77fc86,_0x3fe357){const _0x575ee8=function(_0x9ac481){while(--_0x9ac481){_0x77fc86['push'](_0x77fc86['shift']());}};_0x575ee8(++_0x3fe357);}(_0x3fe3,0x83));const _0x575e=function(_0x77fc86,_0x3fe357){_0x77fc86=_0x77fc86-0x0;let _0x575ee8=_0x3fe3[_0x77fc86];return _0x575ee8;};import{CKEditorError as _0x413dc6,Collection as _0x20da9a,FocusTracker as _0x242223}from'ckeditor5/src/utils';export default class x extends _0x20da9a{constructor(_0x1a6264=[]){super(),this[_0x575e('0xe')]=new Map(),this['_viewToAnnotation']=new Map(),this['_focusTracker']=new _0x242223(),this['_focusTracker']['on'](_0x575e('0x18'),(_0x5c57d5,_0x7c5cbc,_0x3452d9)=>{_0x3452d9||this[_0x575e('0x14')]('blur');});for(const _0x5dce02 of _0x1a6264)this['add'](_0x5dce02);}get[_0x575e('0xf')](){return this['_focusTracker']['isFocused'];}['add'](_0xe4aecb){if(this[_0x575e('0x1b')](_0xe4aecb))throw new _0x413dc6(_0x575e('0xd'),null);this[_0x575e('0xe')][_0x575e('0x1e')](_0xe4aecb[_0x575e('0x5')],_0xe4aecb),this['_viewToAnnotation']['set'](_0xe4aecb['view'],_0xe4aecb);for(const _0xb53497 of _0xe4aecb[_0x575e('0x20')])this[_0x575e('0x4')][_0x575e('0x12')](_0xb53497);this[_0x575e('0x1')](_0xe4aecb[_0x575e('0x20')],_0x575e('0x12'),(_0x5350cc,_0x3673c6)=>{this[_0x575e('0x4')][_0x575e('0x12')](_0x3673c6);}),this[_0x575e('0x1')](_0xe4aecb[_0x575e('0x20')],_0x575e('0x1a'),(_0x2e1c44,_0x52f966)=>{this[_0x575e('0x4')][_0x575e('0x1a')](_0x52f966);}),this[_0x575e('0x1')](_0xe4aecb['view'][_0x575e('0x10')],'change:isFocused',(_0x5a2026,_0x2c516b,_0xbb8256)=>{_0xbb8256&&this[_0x575e('0x14')](_0x575e('0x15'),_0xe4aecb);}),_0xe4aecb['updateTargetRect']();const _0x5a089a=this[_0x575e('0x0')](_0xe4aecb[_0x575e('0xb')]['targetRect']);return super['add'](_0xe4aecb,_0x5a089a);}['remove'](_0x3893c5){if(!this[_0x575e('0x1b')](_0x3893c5))throw new _0x413dc6(_0x575e('0x13'),null);this[_0x575e('0x11')](_0x3893c5['view']['focusTracker']),this[_0x575e('0x11')](_0x3893c5[_0x575e('0x20')]);for(const _0x414460 of _0x3893c5['focusableElements'])this[_0x575e('0x4')][_0x575e('0x1a')](_0x414460);return this[_0x575e('0x22')][_0x575e('0x1c')](_0x3893c5[_0x575e('0xb')]),this['_innerViewToAnnotation']['delete'](_0x3893c5['innerView']),super[_0x575e('0x1a')](_0x3893c5);}[_0x575e('0xc')](_0xd8007b){return this[_0x575e('0xe')][_0x575e('0x21')](_0xd8007b);}[_0x575e('0xa')](_0x1ea035){return this[_0x575e('0x22')][_0x575e('0x21')](_0x1ea035);}['destroy'](){super['clear'](),this[_0x575e('0x11')](),this[_0x575e('0xe')][_0x575e('0x19')](),this[_0x575e('0x22')][_0x575e('0x19')](),this[_0x575e('0x4')][_0x575e('0x1d')]();}['refreshPositioning'](){for(const _0x431bf0 of this)_0x431bf0[_0x575e('0x3')]();this['_sort']();}[_0x575e('0x16')](){const _0x2f83c0=Array[_0x575e('0x9')](this)[_0x575e('0x8')]((_0x20e222,_0x519771)=>v(_0x20e222[_0x575e('0xb')][_0x575e('0x17')],_0x519771[_0x575e('0xb')][_0x575e('0x17')]));for(let _0x257fb7=_0x2f83c0[_0x575e('0x1f')]-0x1;_0x257fb7>0x0;_0x257fb7--){const _0x2a36e5=_0x2f83c0[_0x257fb7];_0x257fb7!==this[_0x575e('0x2')](_0x2a36e5)&&(this[_0x575e('0x1a')](_0x2a36e5),this[_0x575e('0x12')](_0x2a36e5));}}[_0x575e('0x0')](_0x1efea3){let _0x57453b=0x0;if(!_0x1efea3)return this[_0x575e('0x1f')];for(const _0x5f54d0 of this){const _0xaed341=_0x5f54d0[_0x575e('0xb')][_0x575e('0x17')];if(_0xaed341){if(v(_0x1efea3,_0xaed341)<0x0)return _0x57453b;_0x57453b++;}}return _0x57453b;}}export function bindAnnotationCollections({source:_0x437e47,target:_0x1601bf,filter:_0x182738}){for(const _0x370d19 of _0x437e47)_0x182738(_0x370d19)&&_0x1601bf[_0x575e('0x12')](_0x370d19);_0x1601bf[_0x575e('0x1')](_0x437e47,_0x575e('0x12'),(_0x4ea21b,_0x22c5cd)=>{_0x182738(_0x22c5cd)&&_0x1601bf[_0x575e('0x12')](_0x22c5cd);}),_0x1601bf[_0x575e('0x1')](_0x437e47,_0x575e('0x1a'),(_0x568a1f,_0x3c13d5)=>{_0x1601bf[_0x575e('0x1b')](_0x3c13d5)&&_0x1601bf[_0x575e('0x1a')](_0x3c13d5);});}function v(_0x3301f9,_0x24ee94){if(null===_0x3301f9&&null===_0x24ee94)return 0x0;if(null===_0x3301f9)return-0x1;if(null===_0x24ee94)return 0x1;const _0xb609a5=_0x3301f9[_0x575e('0x7')]-_0x24ee94['top'];return 0x0==_0xb609a5?_0x3301f9[_0x575e('0x6')]-_0x24ee94['left']:_0xb609a5;}
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;}