@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,67 +1,67 @@
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/editorannotations
7
- * @publicApi
8
- */
9
- import { Plugin, type Editor } from 'ckeditor5/src/core';
10
- import Annotations from './annotations';
11
- import type Annotation from './annotation';
12
- import type AnnotationCollection from './annotationcollection';
13
- /**
14
- * Integrates {@link module:comments/annotations/annotations~Annotations annotations} with the editor to provide proper behavior
15
- * for annotations created through the editor features.
16
- *
17
- * *Note: The API of this class might change in the near future.*
18
- *
19
- * Collects all types of the annotations created through the editor features and their markers and decides which annotation is currently
20
- * selected by the selection.
21
- *
22
- * Every editor plugin that adds an annotation should also
23
- * {@link module:comments/annotations/editorannotations~EditorAnnotations#addSourceCollector register a callback}
24
- * in which it will check whether given annotation should be marked as selected.
25
- */
26
- export default class EditorAnnotations extends Plugin {
27
- /**
28
- * @inheritDoc
29
- */
30
- static get requires(): readonly [typeof Annotations];
31
- /**
32
- * @inheritDoc
33
- */
34
- static get pluginName(): "EditorAnnotations";
35
- /**
36
- * @inheritDoc
37
- */
38
- constructor(editor: Editor);
39
- /**
40
- * @inheritDoc
41
- */
42
- init(): void;
43
- /**
44
- * Registers given annotation as an editor annotation, that is an annotation that is linked with a target inside the editor content.
45
- */
46
- registerAnnotation(annotation: Annotation): void;
47
- hasDomSelection(): boolean;
48
- /**
49
- * Registers a callback that collects annotations and their markers.
50
- */
51
- addSourceCollector(callback: Function): void;
52
- /**
53
- * Finds all annotations selected by the editor selection and marks the most inner one as the active annotation.
54
- */
55
- refreshSelectedViews(): void;
56
- /**
57
- * Finds all annotations for selected markers in order from the most inner marker to the most outer marker.
58
- *
59
- * @param options.annotations The collection of annotations for given UI.
60
- * @param options.activeAnnotation The given UI active annotation.
61
- * It is used to determine the order if the selection contains the active annotation's marker.
62
- */
63
- getOrderedSelectedAnnotations({ activeAnnotation, annotations }: {
64
- activeAnnotation: Annotation | null;
65
- annotations: AnnotationCollection;
66
- }): Array<Annotation>;
67
- }
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/editorannotations
7
+ * @publicApi
8
+ */
9
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
10
+ import Annotations from './annotations';
11
+ import type Annotation from './annotation';
12
+ import type AnnotationCollection from './annotationcollection';
13
+ /**
14
+ * Integrates {@link module:comments/annotations/annotations~Annotations annotations} with the editor to provide proper behavior
15
+ * for annotations created through the editor features.
16
+ *
17
+ * *Note: The API of this class might change in the near future.*
18
+ *
19
+ * Collects all types of the annotations created through the editor features and their markers and decides which annotation is currently
20
+ * selected by the selection.
21
+ *
22
+ * Every editor plugin that adds an annotation should also
23
+ * {@link module:comments/annotations/editorannotations~EditorAnnotations#addSourceCollector register a callback}
24
+ * in which it will check whether given annotation should be marked as selected.
25
+ */
26
+ export default class EditorAnnotations extends Plugin {
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ static get requires(): readonly [typeof Annotations];
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ static get pluginName(): "EditorAnnotations";
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ constructor(editor: Editor);
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ init(): void;
43
+ /**
44
+ * Registers given annotation as an editor annotation, that is an annotation that is linked with a target inside the editor content.
45
+ */
46
+ registerAnnotation(annotation: Annotation): void;
47
+ hasDomSelection(): boolean;
48
+ /**
49
+ * Registers a callback that collects annotations and their markers.
50
+ */
51
+ addSourceCollector(callback: Function): void;
52
+ /**
53
+ * Finds all annotations selected by the editor selection and marks the most inner one as the active annotation.
54
+ */
55
+ refreshSelectedViews(): void;
56
+ /**
57
+ * Finds all annotations for selected markers in order from the most inner marker to the most outer marker.
58
+ *
59
+ * @param options.annotations The collection of annotations for given UI.
60
+ * @param options.activeAnnotation The given UI active annotation.
61
+ * It is used to determine the order if the selection contains the active annotation's marker.
62
+ */
63
+ getOrderedSelectedAnnotations({ activeAnnotation, annotations }: {
64
+ activeAnnotation: Annotation | null;
65
+ annotations: AnnotationCollection;
66
+ }): Array<Annotation>;
67
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x43ea=['isCollapsed','editorannotations-invalid-source-callback','document','_dataCollectors','change:range','fire','delete','init','registerAnnotation','from','change:isFocused','pluginName','addSourceCollector','collection','sort','_editorAnnotations','requires','editing','annotation','model','blur','uiUpdate','getRanges','plugins','selection','editor','containsRange','isReadOnly','focusTracker','has','getByInnerView','_editorAnnotationsData','function','hasDomSelection','remove','directChange','listenTo','view','range','innerView','push','update','refresh','add','refreshSelectedViews'];(function(_0x4cd92d,_0x43ea9f){const _0x1b6d04=function(_0x7ddee9){while(--_0x7ddee9){_0x4cd92d['push'](_0x4cd92d['shift']());}};_0x1b6d04(++_0x43ea9f);}(_0x43ea,0x1a7));const _0x1b6d=function(_0x4cd92d,_0x43ea9f){_0x4cd92d=_0x4cd92d-0x0;let _0x1b6d04=_0x43ea[_0x4cd92d];return _0x1b6d04;};import{Plugin as _0x12c412}from'ckeditor5/src/core';import{CKEditorError as _0x33b60c}from'ckeditor5/src/utils';import{debounce as _0x312117}from'lodash-es';import _0x2cb62e from'./annotations';export default class k extends _0x12c412{static get[_0x1b6d('0x2b')](){return[_0x2cb62e];}static get[_0x1b6d('0x26')](){return'EditorAnnotations';}constructor(_0x1961dd){super(_0x1961dd),this[_0x1b6d('0x1e')]=new Set(),this[_0x1b6d('0x2a')]=new Set();}[_0x1b6d('0x22')](){const _0x110d48=this[_0x1b6d('0x7')],_0x33d9e8=_0x110d48[_0x1b6d('0x1')][_0x1b6d('0x1d')][_0x1b6d('0x6')],_0x9cfba3=_0x312117(()=>this[_0x1b6d('0x1a')](),0xa);_0x33d9e8['on'](_0x1b6d('0x1f'),(_0x3bce26,_0x12aa5e)=>{_0x12aa5e[_0x1b6d('0x11')]&&(_0x9cfba3['cancel'](),this[_0x1b6d('0x1a')]());}),this[_0x1b6d('0x12')](_0x110d48['editing']['view'][_0x1b6d('0x1d')],_0x1b6d('0x25'),(_0x3e7fc4,_0x3e15ee,_0x25edcd)=>{_0x25edcd&&_0x9cfba3();}),this['listenTo'](_0x110d48['ui'][_0x1b6d('0xa')],_0x1b6d('0x25'),(_0x373bc1,_0x5ba019,_0x47e9e4)=>{_0x47e9e4||_0x110d48[_0x1b6d('0x9')]||this['fire'](_0x1b6d('0x2'),{'isAnnotationTracked':_0x13427b=>this['_editorAnnotationsData'][_0x1b6d('0xb')](_0x13427b[_0x1b6d('0x15')])});}),this[_0x1b6d('0x12')](this[_0x1b6d('0x7')]['ui'],_0x1b6d('0x17'),()=>this[_0x1b6d('0x20')](_0x1b6d('0x3')));}[_0x1b6d('0x23')](_0x3d8cfd){if(this[_0x1b6d('0x2a')][_0x1b6d('0xb')](_0x3d8cfd[_0x1b6d('0x13')]))return;this[_0x1b6d('0x2a')][_0x1b6d('0x19')](_0x3d8cfd['view']),this[_0x1b6d('0x7')]['ui'][_0x1b6d('0xa')][_0x1b6d('0x19')](_0x3d8cfd['view']['element']);const _0x5da015=this[_0x1b6d('0x7')][_0x1b6d('0x5')]['get'](_0x2cb62e);this[_0x1b6d('0x12')](_0x5da015[_0x1b6d('0x28')],_0x1b6d('0x10'),(_0xd83084,_0x538cd7)=>{this[_0x1b6d('0x7')]['ui']['focusTracker']['remove'](_0x538cd7[_0x1b6d('0x13')]['element']),this[_0x1b6d('0x2a')][_0x1b6d('0x21')](_0x538cd7[_0x1b6d('0x13')]);});}[_0x1b6d('0xf')](){return this[_0x1b6d('0x7')][_0x1b6d('0x2c')][_0x1b6d('0x13')][_0x1b6d('0xf')];}[_0x1b6d('0x27')](_0x2d3ac4){if(_0x1b6d('0xe')!=typeof _0x2d3ac4)throw new _0x33b60c(_0x1b6d('0x1c'));this[_0x1b6d('0x1e')]['add'](_0x2d3ac4);}['refreshSelectedViews'](){this['fire'](_0x1b6d('0x18'));}['getOrderedSelectedAnnotations']({activeAnnotation:_0x1afe65,annotations:_0x5df738}){const _0x5d76a4=[],_0x55984e=this[_0x1b6d('0x7')][_0x1b6d('0x1')][_0x1b6d('0x1d')][_0x1b6d('0x6')],_0x25b46b=Array[_0x1b6d('0x24')](_0x55984e[_0x1b6d('0x4')]());for(const [_0x49cf18,_0x1dcb39]of this[_0x1b6d('0xd')]){const _0x3e9c29=_0x19482b(_0x1dcb39),_0x51e08a=_0x5df738[_0x1b6d('0xc')](_0x49cf18);_0x3e9c29&&_0x51e08a&&_0x5d76a4[_0x1b6d('0x16')]({'annotation':_0x51e08a,'range':_0x3e9c29});}function _0x19482b(_0x40965e){for(const _0x45f424 of _0x40965e)for(const _0x32abfd of _0x25b46b)if(_0x45f424[_0x1b6d('0x8')](_0x32abfd,!_0x55984e[_0x1b6d('0x1b')]))return _0x45f424;return null;}return _0x5d76a4[_0x1b6d('0x29')]((_0xcbc8e6,_0x2eb3e7)=>{const _0x5e95a7=_0xcbc8e6[_0x1b6d('0x14')],_0x1c31bb=_0x2eb3e7[_0x1b6d('0x14')];if(!_0x5e95a7['isEqual'](_0x1c31bb)){if(_0x5e95a7[_0x1b6d('0x8')](_0x1c31bb,!0x0))return 0x1;if(_0x1c31bb[_0x1b6d('0x8')](_0x5e95a7,!0x0))return-0x1;}return _0xcbc8e6[_0x1b6d('0x0')]==_0x1afe65?-0x1:_0x2eb3e7[_0x1b6d('0x0')]==_0x1afe65?0x1:0x0;})['map'](_0x3ecae8=>_0x3ecae8[_0x1b6d('0x0')]);}get['_editorAnnotationsData'](){const _0x4860a0=new Map();for(const _0x28fd39 of Array['from'](this[_0x1b6d('0x1e')]))for(const [_0x19fac1,_0x368542]of _0x28fd39())_0x4860a0['set'](_0x19fac1,_0x368542);return _0x4860a0;}}
23
+ const _0xeda8=['uiUpdate','listenTo','getRanges','getByInnerView','isEqual','model','remove','element','change:isFocused','set','get','editor','selection','function','document','focusTracker','getOrderedSelectedAnnotations','containsRange','from','editorannotations-invalid-source-callback','isReadOnly','add','update','hasDomSelection','innerView','_editorAnnotationsData','editing','addSourceCollector','annotation','change:range','range','sort','fire','_dataCollectors','directChange','view','isCollapsed','_editorAnnotations','has','refreshSelectedViews','pluginName','cancel','refresh','delete','init'];(function(_0x2aeee9,_0xeda806){const _0x441843=function(_0x47c21f){while(--_0x47c21f){_0x2aeee9['push'](_0x2aeee9['shift']());}};_0x441843(++_0xeda806);}(_0xeda8,0x118));const _0x4418=function(_0x2aeee9,_0xeda806){_0x2aeee9=_0x2aeee9-0x0;let _0x441843=_0xeda8[_0x2aeee9];return _0x441843;};import{Plugin as _0x4670bd}from'ckeditor5/src/core';import{CKEditorError as _0x2c57d6}from'ckeditor5/src/utils';import{debounce as _0x316b7a}from'lodash-es';import _0x12fac9 from'./annotations';export default class k extends _0x4670bd{static get['requires'](){return[_0x12fac9];}static get[_0x4418('0x1e')](){return'EditorAnnotations';}constructor(_0xcd596){super(_0xcd596),this[_0x4418('0x17')]=new Set(),this['_editorAnnotations']=new Set();}[_0x4418('0x22')](){const _0x533508=this[_0x4418('0x1')],_0x3015b2=_0x533508[_0x4418('0x28')][_0x4418('0x4')][_0x4418('0x2')],_0x3c0822=_0x316b7a(()=>this[_0x4418('0x1d')](),0xa);_0x3015b2['on'](_0x4418('0x13'),(_0xf0add8,_0x38b5fd)=>{_0x38b5fd[_0x4418('0x18')]&&(_0x3c0822[_0x4418('0x1f')](),this[_0x4418('0x1d')]());}),this['listenTo'](_0x533508['editing']['view']['document'],_0x4418('0x2b'),(_0x2f42f6,_0x11b22c,_0x3be201)=>{_0x3be201&&_0x3c0822();}),this[_0x4418('0x24')](_0x533508['ui']['focusTracker'],_0x4418('0x2b'),(_0x361cf9,_0x40d41b,_0x830a29)=>{_0x830a29||_0x533508[_0x4418('0xa')]||this[_0x4418('0x16')]('blur',{'isAnnotationTracked':_0x376dd9=>this[_0x4418('0xf')]['has'](_0x376dd9[_0x4418('0xe')])});}),this['listenTo'](this[_0x4418('0x1')]['ui'],_0x4418('0xc'),()=>this['fire'](_0x4418('0x23')));}['registerAnnotation'](_0x559e56){if(this[_0x4418('0x1b')][_0x4418('0x1c')](_0x559e56[_0x4418('0x19')]))return;this[_0x4418('0x1b')][_0x4418('0xb')](_0x559e56[_0x4418('0x19')]),this[_0x4418('0x1')]['ui']['focusTracker']['add'](_0x559e56['view'][_0x4418('0x2a')]);const _0x2621b4=this[_0x4418('0x1')]['plugins'][_0x4418('0x0')](_0x12fac9);this[_0x4418('0x24')](_0x2621b4['collection'],_0x4418('0x29'),(_0x14c784,_0x1efd03)=>{this[_0x4418('0x1')]['ui'][_0x4418('0x5')]['remove'](_0x1efd03['view']['element']),this[_0x4418('0x1b')][_0x4418('0x21')](_0x1efd03[_0x4418('0x19')]);});}['hasDomSelection'](){return this[_0x4418('0x1')][_0x4418('0x10')][_0x4418('0x19')][_0x4418('0xd')];}[_0x4418('0x11')](_0x22d208){if(_0x4418('0x3')!=typeof _0x22d208)throw new _0x2c57d6(_0x4418('0x9'));this['_dataCollectors']['add'](_0x22d208);}[_0x4418('0x1d')](){this[_0x4418('0x16')](_0x4418('0x20'));}[_0x4418('0x6')]({activeAnnotation:_0x4ab116,annotations:_0x3a0e06}){const _0x26f0fe=[],_0x512a16=this[_0x4418('0x1')][_0x4418('0x28')][_0x4418('0x4')][_0x4418('0x2')],_0x5579ab=Array[_0x4418('0x8')](_0x512a16[_0x4418('0x25')]());for(const [_0x47ad5d,_0x21470e]of this[_0x4418('0xf')]){const _0x26d454=_0x58fc04(_0x21470e),_0x19130a=_0x3a0e06[_0x4418('0x26')](_0x47ad5d);_0x26d454&&_0x19130a&&_0x26f0fe['push']({'annotation':_0x19130a,'range':_0x26d454});}function _0x58fc04(_0x409381){for(const _0x1a65fd of _0x409381)for(const _0x5839fc of _0x5579ab)if(_0x1a65fd['containsRange'](_0x5839fc,!_0x512a16[_0x4418('0x1a')]))return _0x1a65fd;return null;}return _0x26f0fe[_0x4418('0x15')]((_0x593b4a,_0x2f003c)=>{const _0x4b0f9f=_0x593b4a['range'],_0x11ae03=_0x2f003c[_0x4418('0x14')];if(!_0x4b0f9f[_0x4418('0x27')](_0x11ae03)){if(_0x4b0f9f[_0x4418('0x7')](_0x11ae03,!0x0))return 0x1;if(_0x11ae03[_0x4418('0x7')](_0x4b0f9f,!0x0))return-0x1;}return _0x593b4a['annotation']==_0x4ab116?-0x1:_0x2f003c[_0x4418('0x12')]==_0x4ab116?0x1:0x0;})['map'](_0x33ed29=>_0x33ed29[_0x4418('0x12')]);}get[_0x4418('0xf')](){const _0x5e9f72=new Map();for(const _0x2c159b of Array[_0x4418('0x8')](this[_0x4418('0x17')]))for(const [_0x2d1f5c,_0x503274]of _0x2c159b())_0x5e9f72[_0x4418('0x2c')](_0x2d1f5c,_0x503274);return _0x5e9f72;}}
@@ -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/inlineannotations
7
- * @publicApi
8
- */
9
- import { Plugin, type Editor } from 'ckeditor5/src/core';
10
- import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
11
- import EditorAnnotations from './editorannotations';
12
- import { ContextualBalloon } from 'ckeditor5/src/ui';
13
- import './../../theme/annotation-inline.css';
14
- import type Annotation from './annotation';
15
- import type AnnotationCollection from './annotationcollection';
16
- /**
17
- * The popup-style UI for displaying annotations next to editor target elements.
18
- *
19
- * It displays {@link module:comments/annotations/annotation~Annotation annotations} in the
20
- * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon balloon} where the current
21
- * {@link module:comments/annotations/inlineannotations~InlineAnnotations#activeAnnotation} is the displayed one.
22
- *
23
- * Note: this UI type works only with {@link module:core/editor/editor~Editor the Editor} and cannot be used in integrations where
24
- * there is only {@link module:core/context~Context context} without any editor.
25
- *
26
- * This UI is intended for narrow screens.
27
- *
28
- * To activate this UI use one of the following:
29
- *
30
- * ```ts
31
- * editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'inline' );
32
- * editor.plugins.get( 'AnnotationsUIs' ).activate( 'inline', filter );
33
- * ```
34
- *
35
- * See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
36
- */
37
- export default class InlineAnnotations extends Plugin implements AnnotationsUI<Plugin> {
38
- /**
39
- * An active annotation tracked by this UI.
40
- *
41
- * @observable
42
- */
43
- activeAnnotation: Annotation | null;
44
- isAttached: boolean;
45
- /**
46
- * A collection of annotations controlled by this UI.
47
- *
48
- * This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
49
- *
50
- * It is set to `null` if `InlineAnnotations` is not
51
- * {@link module:comments/annotations/inlineannotations~InlineAnnotations#attach attached}.
52
- */
53
- annotations: AnnotationCollection | null;
54
- /**
55
- * @inheritDoc
56
- */
57
- static get requires(): readonly [typeof EditorAnnotations, typeof ContextualBalloon, typeof AnnotationsUIs];
58
- /**
59
- * @inheritDoc
60
- */
61
- static get pluginName(): "InlineAnnotations";
62
- /**
63
- * @inheritDoc
64
- */
65
- constructor(editor: Editor);
66
- /**
67
- * @inheritDoc
68
- */
69
- init(): void;
70
- /**
71
- * @inheritDoc
72
- */
73
- afterInit(): void;
74
- /**
75
- * Sets the active annotation for this UI.
76
- */
77
- setActiveAnnotation(annotation: Annotation | null): void;
78
- /**
79
- * @inheritDoc
80
- */
81
- attach(annotations: AnnotationCollection): void;
82
- /**
83
- * @inheritDoc
84
- */
85
- detach(): void;
86
- /**
87
- * @inheritDoc
88
- */
89
- destroy(): void;
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/inlineannotations
7
+ * @publicApi
8
+ */
9
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
10
+ import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
11
+ import EditorAnnotations from './editorannotations';
12
+ import { ContextualBalloon } from 'ckeditor5/src/ui';
13
+ import './../../theme/annotation-inline.css';
14
+ import type Annotation from './annotation';
15
+ import type AnnotationCollection from './annotationcollection';
16
+ /**
17
+ * The popup-style UI for displaying annotations next to editor target elements.
18
+ *
19
+ * It displays {@link module:comments/annotations/annotation~Annotation annotations} in the
20
+ * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon balloon} where the current
21
+ * {@link module:comments/annotations/inlineannotations~InlineAnnotations#activeAnnotation} is the displayed one.
22
+ *
23
+ * Note: this UI type works only with {@link module:core/editor/editor~Editor the Editor} and cannot be used in integrations where
24
+ * there is only {@link module:core/context~Context context} without any editor.
25
+ *
26
+ * This UI is intended for narrow screens.
27
+ *
28
+ * To activate this UI use one of the following:
29
+ *
30
+ * ```ts
31
+ * editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'inline' );
32
+ * editor.plugins.get( 'AnnotationsUIs' ).activate( 'inline', filter );
33
+ * ```
34
+ *
35
+ * See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
36
+ */
37
+ export default class InlineAnnotations extends Plugin implements AnnotationsUI<Plugin> {
38
+ /**
39
+ * An active annotation tracked by this UI.
40
+ *
41
+ * @observable
42
+ */
43
+ activeAnnotation: Annotation | null;
44
+ isAttached: boolean;
45
+ /**
46
+ * A collection of annotations controlled by this UI.
47
+ *
48
+ * This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
49
+ *
50
+ * It is set to `null` if `InlineAnnotations` is not
51
+ * {@link module:comments/annotations/inlineannotations~InlineAnnotations#attach attached}.
52
+ */
53
+ annotations: AnnotationCollection | null;
54
+ /**
55
+ * @inheritDoc
56
+ */
57
+ static get requires(): readonly [typeof EditorAnnotations, typeof ContextualBalloon, typeof AnnotationsUIs];
58
+ /**
59
+ * @inheritDoc
60
+ */
61
+ static get pluginName(): "InlineAnnotations";
62
+ /**
63
+ * @inheritDoc
64
+ */
65
+ constructor(editor: Editor);
66
+ /**
67
+ * @inheritDoc
68
+ */
69
+ init(): void;
70
+ /**
71
+ * @inheritDoc
72
+ */
73
+ afterInit(): void;
74
+ /**
75
+ * Sets the active annotation for this UI.
76
+ */
77
+ setActiveAnnotation(annotation: Annotation | null): void;
78
+ /**
79
+ * @inheritDoc
80
+ */
81
+ attach(annotations: AnnotationCollection): void;
82
+ /**
83
+ * @inheritDoc
84
+ */
85
+ detach(): void;
86
+ /**
87
+ * @inheritDoc
88
+ */
89
+ destroy(): void;
90
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x56f9=['requires','top','collapse','isFocused','set','attach','refresh','remove','_selectedAnnotations','InlineAnnotations','afterInit','plugins','destroy','left','blur','change:visibleView','showStack','getBoundingClientRect','_addedAnnotations','hasView','focusTracker','hasActive','Esc','width','setActiveAnnotation','selection','activeAnnotation','listenTo','map','bottom','register','_balloon','view','isAttached','getFirstRange','inline','_removeAnnotationFromBalloon','editing','length','add','getByView','_closeAnnotation','includes','every','init','change:height','_setSelectedAnnotations','addObserver','_addAnnotationToBalloon','document','delete','fromRect','_forceRefresh','domConverter','annotations','update','stopListening','targetRect','inlineannotations-not-allowed-with-context','right','focus','getClientRects','editor','isActive','find','get','keystrokes','visibleView','detach','_manuallyClosed','context','has','pluginName','push','_getBalloonTargetForAnnotation','getOrderedSelectedAnnotations','updatePosition'];(function(_0x8fb7bb,_0x56f9a5){const _0x29af8a=function(_0x1aba22){while(--_0x1aba22){_0x8fb7bb['push'](_0x8fb7bb['shift']());}};_0x29af8a(++_0x56f9a5);}(_0x56f9,0x89));const _0x29af=function(_0x8fb7bb,_0x56f9a5){_0x8fb7bb=_0x8fb7bb-0x0;let _0x29af8a=_0x56f9[_0x8fb7bb];return _0x29af8a;};import{Plugin as _0x4e4fb3}from'ckeditor5/src/core';import _0xa0360a from'./annotationsuis';import _0xac1013 from'./editorannotations';import{ContextualBalloon as _0x187e5f}from'ckeditor5/src/ui';import{MouseObserver as _0x482d2d}from'ckeditor5/src/engine';import{CKEditorError as _0x5aceb7,Rect as _0x2f9ec5}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x4e4fb3{static get[_0x29af('0x11')](){return[_0xac1013,_0x187e5f,_0xa0360a];}static get[_0x29af('0xc')](){return _0x29af('0x1a');}constructor(_0x1611d6){super(_0x1611d6),_0x1611d6[_0x29af('0x36')][_0x29af('0x31')][_0x29af('0x40')](_0x482d2d),this['isAttached']=!0x1,this[_0x29af('0x15')](_0x29af('0x2b'),null),this[_0x29af('0x47')]=null,this[_0x29af('0x9')]=new Set(),this['_balloon']=_0x1611d6['plugins'][_0x29af('0x5')](_0x187e5f),this['_addedAnnotations']=new Set(),this['_selectedAnnotations']=[],this[_0x29af('0x45')]=!0x1;}[_0x29af('0x3d')](){const _0x5977d1=this[_0x29af('0x2')][_0x29af('0x1c')][_0x29af('0x5')](_0xa0360a);_0x5977d1[_0x29af('0xa')]===this[_0x29af('0x2')]&&(_0x5977d1[_0x29af('0x2f')]('inline',this),this[_0x29af('0x2')][_0x29af('0x6')][_0x29af('0x15')]('Esc',(_0x4f5068,_0x45550e)=>{const _0x32e8e9=this[_0x29af('0x30')];if(this[_0x29af('0x32')]&&_0x32e8e9['visibleView']){const _0x4e815e=this[_0x29af('0x47')][_0x29af('0x39')](_0x32e8e9['visibleView']);_0x4e815e&&this[_0x29af('0x3a')](_0x4e815e),_0x45550e();}}));}[_0x29af('0x1b')](){const _0x2cbf1f=this[_0x29af('0x2')][_0x29af('0x1c')][_0x29af('0x5')](_0xa0360a);_0x2cbf1f['context']===this[_0x29af('0x2')]&&(_0x2cbf1f[_0x29af('0x26')]()||_0x2cbf1f['switchTo'](_0x29af('0x34')));}[_0x29af('0x29')](_0x1abbaf){_0x1abbaf!==this[_0x29af('0x2b')]&&(this[_0x29af('0x2b')]&&(this[_0x29af('0x2b')][_0x29af('0x3')]=!0x1),_0x1abbaf&&this[_0x29af('0x2')]['ui'][_0x29af('0x25')][_0x29af('0x14')]&&(this[_0x29af('0x47')][_0x29af('0xb')](_0x1abbaf)&&this[_0x29af('0x41')](_0x1abbaf,!0x0),_0x1abbaf['isActive']=!0x0),_0x1abbaf||this[_0x29af('0x3f')]([]),this['activeAnnotation']=_0x1abbaf);}[_0x29af('0x16')](_0x3caa34){this['annotations']=_0x3caa34;const _0x5639c6=this['editor'][_0x29af('0x1c')][_0x29af('0x5')](_0xa0360a),_0x4bfff0=this[_0x29af('0x30')];if(this['isAttached'])throw new _0x5aceb7('inlineannotations-attach-already-attached',this);if(_0x5639c6[_0x29af('0xa')]!==this[_0x29af('0x2')])throw new _0x5aceb7(_0x29af('0x4b'),this);const _0x5ef627=this[_0x29af('0x2')][_0x29af('0x1c')][_0x29af('0x5')](_0xac1013);this[_0x29af('0x2c')](_0x5ef627,_0x29af('0x17'),()=>{const _0x12abbe=_0x5ef627[_0x29af('0xf')]({'annotations':this[_0x29af('0x47')],'activeAnnotation':this[_0x29af('0x2b')]});var _0x6b9807,_0x8bccd7;!this[_0x29af('0x45')]&&(_0x6b9807=_0x12abbe,_0x8bccd7=this['_selectedAnnotations'],_0x6b9807[_0x29af('0x37')]===_0x8bccd7[_0x29af('0x37')]&&_0x6b9807[_0x29af('0x3c')](_0x4662e5=>_0x8bccd7[_0x29af('0x3b')](_0x4662e5)))||(this['_forceRefresh']=!0x1,this[_0x29af('0x3f')](_0x12abbe),this[_0x29af('0x29')](_0x12abbe[0x0]||null));}),this[_0x29af('0x2c')](_0x5ef627,_0x29af('0x1f'),(_0x5d7824,{isAnnotationTracked:_0x4f53aa})=>{this[_0x29af('0x2b')]&&_0x4f53aa(this[_0x29af('0x2b')])&&(this[_0x29af('0x3f')]([]),this[_0x29af('0x29')](null));}),this[_0x29af('0x2c')](this[_0x29af('0x2')]['ui'][_0x29af('0x25')],'change:isFocused',(_0x336656,_0xd63b83,_0x57a091)=>{_0x57a091||this['setActiveAnnotation'](null);}),this[_0x29af('0x2c')](_0x3caa34,'remove',(_0x25e725,_0x8a22a)=>{this[_0x29af('0x35')](_0x8a22a),_0x8a22a===this[_0x29af('0x2b')]&&this[_0x29af('0x29')](null);}),this[_0x29af('0x2c')](_0x4bfff0,_0x29af('0x20'),(_0x43d651,_0x27678a,_0x151789,_0x5ce006)=>{_0x5ce006&&this['stopListening'](_0x5ce006);const _0x3cf1a3=_0x3caa34[_0x29af('0x39')](_0x151789);_0x151789&&_0x3cf1a3&&(this[_0x29af('0x2c')](_0x151789,_0x29af('0x3e'),()=>{_0x4bfff0[_0x29af('0x10')]();}),this['listenTo'](_0x151789,_0x29af('0x27'),()=>{this['_closeAnnotation'](_0x3cf1a3),this[_0x29af('0x2')][_0x29af('0x36')]['view'][_0x29af('0x0')]();}),this[_0x29af('0x2b')]!==_0x3cf1a3&&this[_0x29af('0x29')](_0x3cf1a3));}),this[_0x29af('0x2c')](this[_0x29af('0x2')]['ui'],_0x29af('0x48'),()=>{_0x4bfff0['visibleView']&&(_0x3caa34[_0x29af('0x39')](_0x4bfff0[_0x29af('0x7')])&&_0x4bfff0[_0x29af('0x10')]());}),this[_0x29af('0x2c')](this[_0x29af('0x2')][_0x29af('0x36')][_0x29af('0x31')]['document'],'mousedown',()=>{this[_0x29af('0x45')]=!0x0,this[_0x29af('0x9')]['clear']();}),this[_0x29af('0x2')]['editing'][_0x29af('0x31')][_0x29af('0x42')][_0x29af('0x2a')]['editableElement']&&this[_0x29af('0x2')][_0x29af('0x36')][_0x29af('0x31')][_0x29af('0x0')](),this['isAttached']=!0x0;}[_0x29af('0x8')](){if(!this[_0x29af('0x32')])throw new _0x5aceb7('inlineannotations-detach-not-attached',this);this[_0x29af('0x29')](null);for(const _0x589aa6 of this[_0x29af('0x23')])this['_removeAnnotationFromBalloon'](_0x589aa6);this[_0x29af('0x49')](),this[_0x29af('0x32')]=!0x1,this[_0x29af('0x47')]=null;}[_0x29af('0x1d')](){this['isAttached']&&this[_0x29af('0x8')]();}[_0x29af('0x3f')](_0x41acac){for(const _0x2c5b3d of this[_0x29af('0x19')])_0x41acac[_0x29af('0x3b')](_0x2c5b3d)||this['_manuallyClosed']['delete'](_0x2c5b3d);for(const _0x519f07 of this[_0x29af('0x47')])_0x41acac[_0x29af('0x3b')](_0x519f07)||this[_0x29af('0x35')](_0x519f07);if(this[_0x29af('0x2')]['ui'][_0x29af('0x25')][_0x29af('0x14')])for(const _0x517ef6 of _0x41acac)this[_0x29af('0x41')](_0x517ef6);this[_0x29af('0x19')]=_0x41acac;}[_0x29af('0x41')](_0x46f350,_0x57391c=!0x1){this[_0x29af('0x9')][_0x29af('0xb')](_0x46f350)||(this['_addedAnnotations'][_0x29af('0xb')](_0x46f350)||this[_0x29af('0x30')][_0x29af('0x24')](_0x46f350[_0x29af('0x31')])||(this[_0x29af('0x23')][_0x29af('0x38')](_0x46f350),this[_0x29af('0x30')][_0x29af('0x38')]({'stackId':_0x46f350[_0x29af('0x31')]['id'],'view':_0x46f350['view'],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x46f350)}})),_0x57391c&&this['_balloon'][_0x29af('0x21')](_0x46f350[_0x29af('0x31')]['id']));}[_0x29af('0xe')](_0x1ff727){const _0x57fcb2=_0x1ff727['target'],_0x344e61=this[_0x29af('0x2')]['editing'][_0x29af('0x31')],_0x4d14a0=_0x344e61[_0x29af('0x42')][_0x29af('0x2a')][_0x29af('0x33')](),_0x3a9570=_0x344e61[_0x29af('0x46')]['viewRangeToDom'](_0x4d14a0);if(_0x3a9570[_0x29af('0x13')](!0x0),_0x57fcb2){if(_0x57fcb2 instanceof _0x2f9ec5)return _0x57fcb2;let _0x144ca5=[];for(const _0x5e4863 of _0x57fcb2)_0x144ca5[_0x29af('0xd')](...(_0x2d5d8d=_0x5e4863[_0x29af('0x1')](),Array['from'](_0x2d5d8d)[_0x29af('0x2d')](DOMRect[_0x29af('0x44')])));_0x144ca5=function(_0x4aba1b){const _0x42fa25=[];let _0x42d96b=_0x4aba1b[0x0];for(let _0x47eabb=0x1;_0x47eabb<_0x4aba1b['length'];_0x47eabb++)F(_0x42d96b,_0x4aba1b[_0x47eabb])?_0x42d96b['width']+=_0x4aba1b[_0x47eabb][_0x29af('0x28')]:(_0x42fa25['push'](_0x42d96b),_0x42d96b=_0x4aba1b[_0x47eabb]);return _0x42fa25[_0x29af('0xd')](_0x42d96b),_0x42fa25;}(_0x144ca5);const _0x108215=_0x3a9570[_0x29af('0x22')]();return _0x144ca5[_0x29af('0x4')](_0x1996a3=>_0x1996a3[_0x29af('0x12')]<=_0x108215[_0x29af('0x12')]&&_0x1996a3['bottom']>=_0x108215[_0x29af('0x2e')]&&_0x1996a3[_0x29af('0x1e')]<=_0x108215[_0x29af('0x1e')]&&_0x1996a3['right']>=_0x108215[_0x29af('0x4c')])||_0x144ca5[0x0];}var _0x2d5d8d;return _0x1ff727[_0x29af('0x4a')]||_0x3a9570;}['_removeAnnotationFromBalloon'](_0x13ce21){this['_addedAnnotations'][_0x29af('0xb')](_0x13ce21)&&this[_0x29af('0x30')][_0x29af('0x24')](_0x13ce21[_0x29af('0x31')])&&(this[_0x29af('0x23')][_0x29af('0x43')](_0x13ce21),this['_balloon'][_0x29af('0x18')](_0x13ce21[_0x29af('0x31')]));}[_0x29af('0x3a')](_0x5dc2cd){this[_0x29af('0x9')][_0x29af('0x38')](_0x5dc2cd),this[_0x29af('0x35')](_0x5dc2cd);}}function F(_0x3fef60,_0x29e14a){return _0x3fef60['top']===_0x29e14a[_0x29af('0x12')]&&_0x3fef60['bottom']===_0x29e14a[_0x29af('0x2e')]&&_0x3fef60[_0x29af('0x4c')]===_0x29e14a['left'];}
23
+ const _0x419b=['fromRect','editableElement','right','annotations','focusTracker','bottom','_removeAnnotationFromBalloon','push','clear','focus','plugins','top','inlineannotations-not-allowed-with-context','visibleView','stopListening','hasActive','update','afterInit','context','getOrderedSelectedAnnotations','remove','mousedown','view','get','editor','length','every','inline','updatePosition','selection','keystrokes','_addedAnnotations','isAttached','register','showStack','_manuallyClosed','listenTo','targetRect','isFocused','attach','_getBalloonTargetForAnnotation','addObserver','requires','set','inlineannotations-detach-not-attached','has','getByView','activeAnnotation','_setSelectedAnnotations','from','collapse','setActiveAnnotation','InlineAnnotations','_selectedAnnotations','_closeAnnotation','getFirstRange','pluginName','isActive','document','_balloon','Esc','add','left','destroy','includes','change:visibleView','hasView','getClientRects','editing','_forceRefresh','viewRangeToDom'];(function(_0x5a6457,_0x419b81){const _0x575775=function(_0x2c4f48){while(--_0x2c4f48){_0x5a6457['push'](_0x5a6457['shift']());}};_0x575775(++_0x419b81);}(_0x419b,0x1e0));const _0x5757=function(_0x5a6457,_0x419b81){_0x5a6457=_0x5a6457-0x0;let _0x575775=_0x419b[_0x5a6457];return _0x575775;};import{Plugin as _0x17a5a1}from'ckeditor5/src/core';import _0xa15a8a from'./annotationsuis';import _0x5b7ead from'./editorannotations';import{ContextualBalloon as _0x255486}from'ckeditor5/src/ui';import{MouseObserver as _0x3de05e}from'ckeditor5/src/engine';import{CKEditorError as _0x5e91dd,Rect as _0x45a20c}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x17a5a1{static get[_0x5757('0x3b')](){return[_0x5b7ead,_0x255486,_0xa15a8a];}static get[_0x5757('0x2')](){return _0x5757('0x45');}constructor(_0x470fbe){super(_0x470fbe),_0x470fbe[_0x5757('0xe')]['view'][_0x5757('0x3a')](_0x3de05e),this['isAttached']=!0x1,this[_0x5757('0x3c')](_0x5757('0x40'),null),this[_0x5757('0x14')]=null,this['_manuallyClosed']=new Set(),this[_0x5757('0x5')]=_0x470fbe[_0x5757('0x1b')][_0x5757('0x28')](_0x255486),this[_0x5757('0x30')]=new Set(),this['_selectedAnnotations']=[],this[_0x5757('0xf')]=!0x1;}['init'](){const _0x453efb=this['editor'][_0x5757('0x1b')][_0x5757('0x28')](_0xa15a8a);_0x453efb[_0x5757('0x23')]===this['editor']&&(_0x453efb[_0x5757('0x32')](_0x5757('0x2c'),this),this[_0x5757('0x29')][_0x5757('0x2f')][_0x5757('0x3c')](_0x5757('0x6'),(_0x188e06,_0x52182d)=>{const _0x336260=this[_0x5757('0x5')];if(this[_0x5757('0x31')]&&_0x336260[_0x5757('0x1e')]){const _0x1c0840=this['annotations']['getByView'](_0x336260[_0x5757('0x1e')]);_0x1c0840&&this[_0x5757('0x0')](_0x1c0840),_0x52182d();}}));}[_0x5757('0x22')](){const _0x1a7974=this[_0x5757('0x29')]['plugins'][_0x5757('0x28')](_0xa15a8a);_0x1a7974[_0x5757('0x23')]===this[_0x5757('0x29')]&&(_0x1a7974[_0x5757('0x20')]()||_0x1a7974['switchTo'](_0x5757('0x2c')));}['setActiveAnnotation'](_0x4f2335){_0x4f2335!==this[_0x5757('0x40')]&&(this[_0x5757('0x40')]&&(this[_0x5757('0x40')][_0x5757('0x3')]=!0x1),_0x4f2335&&this[_0x5757('0x29')]['ui'][_0x5757('0x15')]['isFocused']&&(this['annotations'][_0x5757('0x3e')](_0x4f2335)&&this['_addAnnotationToBalloon'](_0x4f2335,!0x0),_0x4f2335['isActive']=!0x0),_0x4f2335||this['_setSelectedAnnotations']([]),this['activeAnnotation']=_0x4f2335);}[_0x5757('0x38')](_0x7dc318){this[_0x5757('0x14')]=_0x7dc318;const _0x1e144d=this[_0x5757('0x29')]['plugins'][_0x5757('0x28')](_0xa15a8a),_0x1b927f=this['_balloon'];if(this[_0x5757('0x31')])throw new _0x5e91dd('inlineannotations-attach-already-attached',this);if(_0x1e144d['context']!==this[_0x5757('0x29')])throw new _0x5e91dd(_0x5757('0x1d'),this);const _0x3a3bc9=this['editor'][_0x5757('0x1b')][_0x5757('0x28')](_0x5b7ead);this[_0x5757('0x35')](_0x3a3bc9,'refresh',()=>{const _0x4c9d9e=_0x3a3bc9[_0x5757('0x24')]({'annotations':this['annotations'],'activeAnnotation':this[_0x5757('0x40')]});var _0x2ebe1d,_0x3993a7;!this['_forceRefresh']&&(_0x2ebe1d=_0x4c9d9e,_0x3993a7=this['_selectedAnnotations'],_0x2ebe1d[_0x5757('0x2a')]===_0x3993a7[_0x5757('0x2a')]&&_0x2ebe1d[_0x5757('0x2b')](_0x46cd23=>_0x3993a7['includes'](_0x46cd23)))||(this[_0x5757('0xf')]=!0x1,this[_0x5757('0x41')](_0x4c9d9e),this[_0x5757('0x44')](_0x4c9d9e[0x0]||null));}),this['listenTo'](_0x3a3bc9,'blur',(_0x4ce402,{isAnnotationTracked:_0x57c86c})=>{this[_0x5757('0x40')]&&_0x57c86c(this[_0x5757('0x40')])&&(this[_0x5757('0x41')]([]),this['setActiveAnnotation'](null));}),this['listenTo'](this['editor']['ui'][_0x5757('0x15')],'change:isFocused',(_0x3057bd,_0x24a3b6,_0x39e926)=>{_0x39e926||this['setActiveAnnotation'](null);}),this['listenTo'](_0x7dc318,_0x5757('0x25'),(_0x4c7d23,_0x519cd2)=>{this['_removeAnnotationFromBalloon'](_0x519cd2),_0x519cd2===this[_0x5757('0x40')]&&this['setActiveAnnotation'](null);}),this[_0x5757('0x35')](_0x1b927f,_0x5757('0xb'),(_0x51fbd1,_0x4c0b94,_0x53233e,_0x5a5c8c)=>{_0x5a5c8c&&this['stopListening'](_0x5a5c8c);const _0x5734a6=_0x7dc318[_0x5757('0x3f')](_0x53233e);_0x53233e&&_0x5734a6&&(this[_0x5757('0x35')](_0x53233e,'change:height',()=>{_0x1b927f[_0x5757('0x2d')]();}),this[_0x5757('0x35')](_0x53233e,_0x5757('0x6'),()=>{this[_0x5757('0x0')](_0x5734a6),this[_0x5757('0x29')][_0x5757('0xe')][_0x5757('0x27')][_0x5757('0x1a')]();}),this['activeAnnotation']!==_0x5734a6&&this[_0x5757('0x44')](_0x5734a6));}),this[_0x5757('0x35')](this[_0x5757('0x29')]['ui'],_0x5757('0x21'),()=>{_0x1b927f[_0x5757('0x1e')]&&(_0x7dc318[_0x5757('0x3f')](_0x1b927f['visibleView'])&&_0x1b927f[_0x5757('0x2d')]());}),this[_0x5757('0x35')](this[_0x5757('0x29')]['editing'][_0x5757('0x27')]['document'],_0x5757('0x26'),()=>{this[_0x5757('0xf')]=!0x0,this[_0x5757('0x34')][_0x5757('0x19')]();}),this['editor'][_0x5757('0xe')]['view'][_0x5757('0x4')][_0x5757('0x2e')][_0x5757('0x12')]&&this['editor'][_0x5757('0xe')][_0x5757('0x27')][_0x5757('0x1a')](),this[_0x5757('0x31')]=!0x0;}['detach'](){if(!this[_0x5757('0x31')])throw new _0x5e91dd(_0x5757('0x3d'),this);this[_0x5757('0x44')](null);for(const _0x5078d8 of this[_0x5757('0x30')])this[_0x5757('0x17')](_0x5078d8);this[_0x5757('0x1f')](),this['isAttached']=!0x1,this[_0x5757('0x14')]=null;}[_0x5757('0x9')](){this[_0x5757('0x31')]&&this['detach']();}[_0x5757('0x41')](_0x221564){for(const _0x51fc8a of this[_0x5757('0x46')])_0x221564[_0x5757('0xa')](_0x51fc8a)||this[_0x5757('0x34')]['delete'](_0x51fc8a);for(const _0x4ea874 of this[_0x5757('0x14')])_0x221564[_0x5757('0xa')](_0x4ea874)||this[_0x5757('0x17')](_0x4ea874);if(this['editor']['ui'][_0x5757('0x15')][_0x5757('0x37')])for(const _0x8ee7d3 of _0x221564)this['_addAnnotationToBalloon'](_0x8ee7d3);this['_selectedAnnotations']=_0x221564;}['_addAnnotationToBalloon'](_0x4e1c30,_0x41f1f9=!0x1){this[_0x5757('0x34')][_0x5757('0x3e')](_0x4e1c30)||(this[_0x5757('0x30')][_0x5757('0x3e')](_0x4e1c30)||this[_0x5757('0x5')]['hasView'](_0x4e1c30[_0x5757('0x27')])||(this[_0x5757('0x30')][_0x5757('0x7')](_0x4e1c30),this[_0x5757('0x5')][_0x5757('0x7')]({'stackId':_0x4e1c30[_0x5757('0x27')]['id'],'view':_0x4e1c30[_0x5757('0x27')],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x4e1c30)}})),_0x41f1f9&&this[_0x5757('0x5')][_0x5757('0x33')](_0x4e1c30[_0x5757('0x27')]['id']));}[_0x5757('0x39')](_0x2a6c38){const _0x1ef052=_0x2a6c38['target'],_0x486cca=this[_0x5757('0x29')][_0x5757('0xe')][_0x5757('0x27')],_0x2c77c4=_0x486cca[_0x5757('0x4')][_0x5757('0x2e')][_0x5757('0x1')](),_0x1bf54e=_0x486cca['domConverter'][_0x5757('0x10')](_0x2c77c4);if(_0x1bf54e[_0x5757('0x43')](!0x0),_0x1ef052){if(_0x1ef052 instanceof _0x45a20c)return _0x1ef052;let _0x2d497d=[];for(const _0x1c80a9 of _0x1ef052)_0x2d497d[_0x5757('0x18')](...(_0x536a15=_0x1c80a9[_0x5757('0xd')](),Array[_0x5757('0x42')](_0x536a15)['map'](DOMRect[_0x5757('0x11')])));_0x2d497d=function(_0x57df40){const _0x38e0b1=[];let _0x1b7b99=_0x57df40[0x0];for(let _0x3b031b=0x1;_0x3b031b<_0x57df40[_0x5757('0x2a')];_0x3b031b++)F(_0x1b7b99,_0x57df40[_0x3b031b])?_0x1b7b99['width']+=_0x57df40[_0x3b031b]['width']:(_0x38e0b1['push'](_0x1b7b99),_0x1b7b99=_0x57df40[_0x3b031b]);return _0x38e0b1[_0x5757('0x18')](_0x1b7b99),_0x38e0b1;}(_0x2d497d);const _0x14f210=_0x1bf54e['getBoundingClientRect']();return _0x2d497d['find'](_0x1d1793=>_0x1d1793[_0x5757('0x1c')]<=_0x14f210[_0x5757('0x1c')]&&_0x1d1793['bottom']>=_0x14f210[_0x5757('0x16')]&&_0x1d1793['left']<=_0x14f210[_0x5757('0x8')]&&_0x1d1793[_0x5757('0x13')]>=_0x14f210[_0x5757('0x13')])||_0x2d497d[0x0];}var _0x536a15;return _0x2a6c38[_0x5757('0x36')]||_0x1bf54e;}[_0x5757('0x17')](_0x3f9817){this[_0x5757('0x30')][_0x5757('0x3e')](_0x3f9817)&&this[_0x5757('0x5')][_0x5757('0xc')](_0x3f9817[_0x5757('0x27')])&&(this['_addedAnnotations']['delete'](_0x3f9817),this[_0x5757('0x5')][_0x5757('0x25')](_0x3f9817[_0x5757('0x27')]));}[_0x5757('0x0')](_0x4ef1c9){this[_0x5757('0x34')][_0x5757('0x7')](_0x4ef1c9),this[_0x5757('0x17')](_0x4ef1c9);}}function F(_0x222783,_0xa4d1da){return _0x222783['top']===_0xa4d1da['top']&&_0x222783[_0x5757('0x16')]===_0xa4d1da[_0x5757('0x16')]&&_0x222783[_0x5757('0x13')]===_0xa4d1da[_0x5757('0x8')];}
@@ -1,85 +1,85 @@
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/narrowsidebar
7
- * @publicApi
8
- */
9
- import { ContextPlugin, Context, type Editor } from 'ckeditor5/src/core';
10
- import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
11
- import Sidebar from './sidebar';
12
- import { BalloonPanelView, BodyCollection } from 'ckeditor5/src/ui';
13
- import '../../theme/sidebar-narrow.css';
14
- import type Annotation from './annotation';
15
- import type { default as AnnotationCollection } from './annotationcollection';
16
- /**
17
- * The narrow sidebar UI for displaying annotations.
18
- *
19
- * Binds {@link module:comments/annotations/annotations~Annotations} plugin with
20
- * {@link module:comments/annotations/sidebar~Sidebar} plugin to display annotations in the sidebar as
21
- * {@link module:comments/annotations/view/annotationcounterbuttonview~AnnotationCounterButtonView small icons}.
22
- *
23
- * After selecting an annotation the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} with an
24
- * {@link module:comments/annotations/view/annotationview~AnnotationView} appears attached to the sidebar item.
25
- *
26
- * This UI is intended for medium-sized viewports.
27
- *
28
- * To activate this UI use one of the following:
29
- *
30
- * ```ts
31
- * editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'narrowSidebar' );
32
- * editor.plugins.get( 'AnnotationsUIs' ).activate( 'narrowSidebar', filter );
33
- * ```
34
- *
35
- * See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
36
- */
37
- export default class NarrowSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
38
- /**
39
- * An active annotation tracked by this UI.
40
- */
41
- activeAnnotation: Annotation | null;
42
- bodyCollection: BodyCollection;
43
- balloonPanelView: BalloonPanelView;
44
- isAttached: boolean;
45
- /**
46
- * A collection of annotations controlled by this UI.
47
- *
48
- * This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
49
- *
50
- * It is set to `null` if `NarrowSidebar` is not {@link module:comments/annotations/narrowsidebar~NarrowSidebar#attach attached}.
51
- */
52
- annotations: AnnotationCollection | null;
53
- /**
54
- * @inheritDoc
55
- */
56
- static get requires(): readonly [typeof Sidebar, typeof AnnotationsUIs];
57
- /**
58
- * @inheritDoc
59
- */
60
- static get pluginName(): "NarrowSidebar";
61
- /**
62
- * @inheritDoc
63
- */
64
- constructor(context: Context | Editor);
65
- /**
66
- * @inheritDoc
67
- */
68
- init(): void;
69
- /**
70
- * @inheritDoc
71
- */
72
- attach(annotations: AnnotationCollection): void;
73
- /**
74
- * Sets the active annotation for this UI.
75
- */
76
- setActiveAnnotation(annotation: Annotation | null): void;
77
- /**
78
- * @inheritDoc
79
- */
80
- detach(): void;
81
- /**
82
- * @inheritDoc
83
- */
84
- destroy(): void;
85
- }
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/narrowsidebar
7
+ * @publicApi
8
+ */
9
+ import { ContextPlugin, Context, type Editor } from 'ckeditor5/src/core';
10
+ import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
11
+ import Sidebar from './sidebar';
12
+ import { BalloonPanelView, BodyCollection } from 'ckeditor5/src/ui';
13
+ import '../../theme/sidebar-narrow.css';
14
+ import type Annotation from './annotation';
15
+ import type { default as AnnotationCollection } from './annotationcollection';
16
+ /**
17
+ * The narrow sidebar UI for displaying annotations.
18
+ *
19
+ * Binds {@link module:comments/annotations/annotations~Annotations} plugin with
20
+ * {@link module:comments/annotations/sidebar~Sidebar} plugin to display annotations in the sidebar as
21
+ * {@link module:comments/annotations/view/annotationcounterbuttonview~AnnotationCounterButtonView small icons}.
22
+ *
23
+ * After selecting an annotation the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} with an
24
+ * {@link module:comments/annotations/view/annotationview~AnnotationView} appears attached to the sidebar item.
25
+ *
26
+ * This UI is intended for medium-sized viewports.
27
+ *
28
+ * To activate this UI use one of the following:
29
+ *
30
+ * ```ts
31
+ * editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'narrowSidebar' );
32
+ * editor.plugins.get( 'AnnotationsUIs' ).activate( 'narrowSidebar', filter );
33
+ * ```
34
+ *
35
+ * See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
36
+ */
37
+ export default class NarrowSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
38
+ /**
39
+ * An active annotation tracked by this UI.
40
+ */
41
+ activeAnnotation: Annotation | null;
42
+ bodyCollection: BodyCollection;
43
+ balloonPanelView: BalloonPanelView;
44
+ isAttached: boolean;
45
+ /**
46
+ * A collection of annotations controlled by this UI.
47
+ *
48
+ * This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
49
+ *
50
+ * It is set to `null` if `NarrowSidebar` is not {@link module:comments/annotations/narrowsidebar~NarrowSidebar#attach attached}.
51
+ */
52
+ annotations: AnnotationCollection | null;
53
+ /**
54
+ * @inheritDoc
55
+ */
56
+ static get requires(): readonly [typeof Sidebar, typeof AnnotationsUIs];
57
+ /**
58
+ * @inheritDoc
59
+ */
60
+ static get pluginName(): "NarrowSidebar";
61
+ /**
62
+ * @inheritDoc
63
+ */
64
+ constructor(context: Context | Editor);
65
+ /**
66
+ * @inheritDoc
67
+ */
68
+ init(): void;
69
+ /**
70
+ * @inheritDoc
71
+ */
72
+ attach(annotations: AnnotationCollection): void;
73
+ /**
74
+ * Sets the active annotation for this UI.
75
+ */
76
+ setActiveAnnotation(annotation: Annotation | null): void;
77
+ /**
78
+ * @inheritDoc
79
+ */
80
+ detach(): void;
81
+ /**
82
+ * @inheritDoc
83
+ */
84
+ destroy(): void;
85
+ }