@ckeditor/ckeditor5-comments 36.0.1 → 37.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 (202) hide show
  1. package/build/comments.js +2 -2
  2. package/build/translations/af.js +1 -1
  3. package/build/translations/ar.js +1 -1
  4. package/build/translations/bg.js +1 -1
  5. package/build/translations/bn.js +1 -1
  6. package/build/translations/bs.js +1 -1
  7. package/build/translations/ca.js +1 -1
  8. package/build/translations/cs.js +1 -1
  9. package/build/translations/da.js +1 -1
  10. package/build/translations/de-ch.js +1 -1
  11. package/build/translations/de.js +1 -1
  12. package/build/translations/el.js +1 -1
  13. package/build/translations/en-au.js +1 -1
  14. package/build/translations/es-co.js +1 -1
  15. package/build/translations/es.js +1 -1
  16. package/build/translations/et.js +1 -1
  17. package/build/translations/fa.js +1 -1
  18. package/build/translations/fi.js +1 -1
  19. package/build/translations/fr.js +1 -1
  20. package/build/translations/gl.js +1 -1
  21. package/build/translations/he.js +1 -1
  22. package/build/translations/hi.js +1 -1
  23. package/build/translations/hr.js +1 -1
  24. package/build/translations/hu.js +1 -1
  25. package/build/translations/id.js +1 -1
  26. package/build/translations/it.js +1 -1
  27. package/build/translations/ja.js +1 -1
  28. package/build/translations/jv.js +1 -1
  29. package/build/translations/ko.js +1 -1
  30. package/build/translations/lt.js +1 -1
  31. package/build/translations/lv.js +1 -1
  32. package/build/translations/ms.js +1 -1
  33. package/build/translations/nl.js +1 -1
  34. package/build/translations/no.js +1 -1
  35. package/build/translations/pl.js +1 -1
  36. package/build/translations/pt-br.js +1 -1
  37. package/build/translations/pt.js +1 -1
  38. package/build/translations/ro.js +1 -1
  39. package/build/translations/ru.js +1 -1
  40. package/build/translations/sk.js +1 -1
  41. package/build/translations/sr-latn.js +1 -1
  42. package/build/translations/sr.js +1 -1
  43. package/build/translations/sv.js +1 -1
  44. package/build/translations/th.js +1 -1
  45. package/build/translations/tk.js +1 -1
  46. package/build/translations/tr.js +1 -1
  47. package/build/translations/tt.js +1 -1
  48. package/build/translations/ug.js +1 -1
  49. package/build/translations/uk.js +1 -1
  50. package/build/translations/ur.js +1 -1
  51. package/build/translations/vi.js +1 -1
  52. package/build/translations/zh-cn.js +1 -1
  53. package/build/translations/zh.js +1 -1
  54. package/lang/contexts.json +8 -1
  55. package/lang/translations/af.po +28 -0
  56. package/lang/translations/ar.po +28 -0
  57. package/lang/translations/bg.po +28 -0
  58. package/lang/translations/bn.po +28 -0
  59. package/lang/translations/bs.po +28 -0
  60. package/lang/translations/ca.po +28 -0
  61. package/lang/translations/cs.po +28 -0
  62. package/lang/translations/da.po +28 -0
  63. package/lang/translations/de-ch.po +28 -0
  64. package/lang/translations/de.po +28 -0
  65. package/lang/translations/el.po +28 -0
  66. package/lang/translations/en-au.po +28 -0
  67. package/lang/translations/en.po +28 -0
  68. package/lang/translations/es-co.po +28 -0
  69. package/lang/translations/es.po +28 -0
  70. package/lang/translations/et.po +28 -0
  71. package/lang/translations/fa.po +28 -0
  72. package/lang/translations/fi.po +28 -0
  73. package/lang/translations/fr.po +28 -0
  74. package/lang/translations/gl.po +28 -0
  75. package/lang/translations/he.po +28 -0
  76. package/lang/translations/hi.po +28 -0
  77. package/lang/translations/hr.po +28 -0
  78. package/lang/translations/hu.po +28 -0
  79. package/lang/translations/id.po +28 -0
  80. package/lang/translations/it.po +28 -0
  81. package/lang/translations/ja.po +28 -0
  82. package/lang/translations/jv.po +28 -0
  83. package/lang/translations/ko.po +28 -0
  84. package/lang/translations/lt.po +28 -0
  85. package/lang/translations/lv.po +28 -0
  86. package/lang/translations/ms.po +28 -0
  87. package/lang/translations/nl.po +28 -0
  88. package/lang/translations/no.po +28 -0
  89. package/lang/translations/pl.po +28 -0
  90. package/lang/translations/pt-br.po +28 -0
  91. package/lang/translations/pt.po +28 -0
  92. package/lang/translations/ro.po +28 -0
  93. package/lang/translations/ru.po +28 -0
  94. package/lang/translations/sk.po +28 -0
  95. package/lang/translations/sr-latn.po +28 -0
  96. package/lang/translations/sr.po +29 -1
  97. package/lang/translations/sv.po +28 -0
  98. package/lang/translations/th.po +28 -0
  99. package/lang/translations/tk.po +28 -0
  100. package/lang/translations/tr.po +28 -0
  101. package/lang/translations/tt.po +28 -0
  102. package/lang/translations/ug.po +28 -0
  103. package/lang/translations/uk.po +28 -0
  104. package/lang/translations/ur.po +28 -0
  105. package/lang/translations/vi.po +28 -0
  106. package/lang/translations/zh-cn.po +28 -0
  107. package/lang/translations/zh.po +28 -0
  108. package/package.json +19 -3
  109. package/src/annotations/annotation.d.ts +86 -0
  110. package/src/annotations/annotation.js +1 -1
  111. package/src/annotations/annotationcollection.d.ts +94 -0
  112. package/src/annotations/annotationcollection.js +1 -1
  113. package/src/annotations/annotations.d.ts +150 -0
  114. package/src/annotations/annotations.js +1 -1
  115. package/src/annotations/annotationsuis.d.ts +227 -0
  116. package/src/annotations/annotationsuis.js +1 -1
  117. package/src/annotations/editorannotations.d.ts +62 -0
  118. package/src/annotations/editorannotations.js +1 -1
  119. package/src/annotations/inlineannotations.d.ts +84 -0
  120. package/src/annotations/inlineannotations.js +1 -1
  121. package/src/annotations/narrowsidebar.d.ts +80 -0
  122. package/src/annotations/narrowsidebar.js +1 -1
  123. package/src/annotations/sidebar.d.ts +96 -0
  124. package/src/annotations/sidebar.js +1 -1
  125. package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -0
  126. package/src/annotations/view/annotationcounterbuttonview.js +1 -1
  127. package/src/annotations/view/annotationview.d.ts +86 -0
  128. package/src/annotations/view/annotationview.js +1 -1
  129. package/src/annotations/view/sidebaritemview.d.ts +51 -0
  130. package/src/annotations/view/sidebaritemview.js +1 -1
  131. package/src/annotations/view/sidebarview.d.ts +28 -0
  132. package/src/annotations/view/sidebarview.js +1 -1
  133. package/src/annotations/widesidebar.d.ts +72 -0
  134. package/src/annotations/widesidebar.js +1 -1
  135. package/src/augmentation.d.ts +54 -0
  136. package/src/augmentation.js +23 -0
  137. package/src/comments/addcommentthreadcommand.d.ts +31 -0
  138. package/src/comments/addcommentthreadcommand.js +1 -1
  139. package/src/comments/commentsarchive.d.ts +25 -0
  140. package/src/comments/commentsarchive.js +23 -0
  141. package/src/comments/commentsarchiveui.d.ts +32 -0
  142. package/src/comments/commentsarchiveui.js +23 -0
  143. package/src/comments/commentsediting.d.ts +71 -0
  144. package/src/comments/commentsediting.js +1 -1
  145. package/src/comments/commentsrepository.d.ts +1009 -0
  146. package/src/comments/commentsrepository.js +1 -1
  147. package/src/comments/commentsui.d.ts +25 -0
  148. package/src/comments/commentsui.js +1 -1
  149. package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -0
  150. package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
  151. package/src/comments/integrations/importword.d.ts +17 -0
  152. package/src/comments/integrations/importword.js +1 -1
  153. package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -0
  154. package/src/comments/ui/commenteditor/commenteditor.js +1 -1
  155. package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -0
  156. package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
  157. package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -0
  158. package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
  159. package/src/comments/ui/commentthreadcontroller.d.ts +64 -0
  160. package/src/comments/ui/commentthreadcontroller.js +1 -1
  161. package/src/comments/ui/view/basecommentthreadview.d.ts +108 -0
  162. package/src/comments/ui/view/basecommentthreadview.js +1 -1
  163. package/src/comments/ui/view/basecommentview.d.ts +108 -0
  164. package/src/comments/ui/view/basecommentview.js +1 -1
  165. package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -0
  166. package/src/comments/ui/view/collapsedcommentsview.js +1 -1
  167. package/src/comments/ui/view/commentcontentview.d.ts +10 -0
  168. package/src/comments/ui/view/commentcontentview.js +1 -1
  169. package/src/comments/ui/view/commentinputview.d.ts +76 -0
  170. package/src/comments/ui/view/commentinputview.js +1 -1
  171. package/src/comments/ui/view/commentsarchiveview.d.ts +34 -0
  172. package/src/comments/ui/view/commentsarchiveview.js +23 -0
  173. package/src/comments/ui/view/commentslistview.d.ts +96 -0
  174. package/src/comments/ui/view/commentslistview.js +1 -1
  175. package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -0
  176. package/src/comments/ui/view/commentthreadheaderview.js +23 -0
  177. package/src/comments/ui/view/commentthreadinputview.d.ts +37 -0
  178. package/src/comments/ui/view/commentthreadinputview.js +1 -1
  179. package/src/comments/ui/view/commentthreadview.d.ts +108 -0
  180. package/src/comments/ui/view/commentthreadview.js +1 -1
  181. package/src/comments/ui/view/commentview.d.ts +231 -0
  182. package/src/comments/ui/view/commentview.js +1 -1
  183. package/src/comments.d.ts +22 -0
  184. package/src/comments.js +1 -1
  185. package/src/commentsonly.d.ts +28 -0
  186. package/src/commentsonly.js +1 -1
  187. package/src/config.d.ts +172 -0
  188. package/src/config.js +23 -0
  189. package/src/index.d.ts +19 -0
  190. package/src/index.js +1 -1
  191. package/src/utils/common-translations.d.ts +5 -0
  192. package/src/utils/common-translations.js +1 -1
  193. package/src/utils/createmutationobserver.d.ts +13 -0
  194. package/src/utils/createmutationobserver.js +1 -1
  195. package/theme/annotation.css +1 -0
  196. package/theme/comment.css +31 -0
  197. package/theme/commentsarchive.css +40 -0
  198. package/theme/commentthread.css +68 -1
  199. package/theme/icons/add-comment.svg +1 -1
  200. package/theme/icons/comments-archive.svg +11 -0
  201. package/theme/icons/undo.svg +1 -0
  202. package/theme/sidebar.css +4 -0
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @module comments/annotations/inlineannotations
3
+ * @publicApi
4
+ */
5
+ import { Plugin, type PluginDependencies, type Editor } from 'ckeditor5/src/core';
6
+ import { type AnnotationsUI } from './annotationsuis';
7
+ import './../../theme/annotation-inline.css';
8
+ import type Annotation from './annotation';
9
+ import type AnnotationCollection from './annotationcollection';
10
+ /**
11
+ * The popup-style UI for displaying annotations next to editor target elements.
12
+ *
13
+ * It displays {@link module:comments/annotations/annotation~Annotation annotations} in the
14
+ * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon balloon} where the current
15
+ * {@link module:comments/annotations/inlineannotations~InlineAnnotations#activeAnnotation} is the displayed one.
16
+ *
17
+ * Note: this UI type works only with {@link module:core/editor/editor~Editor the Editor} and cannot be used in integrations where
18
+ * there is only {@link module:core/context~Context context} without any editor.
19
+ *
20
+ * This UI is intended for narrow screens.
21
+ *
22
+ * To activate this UI use one of the following:
23
+ *
24
+ * ```ts
25
+ * editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'inline' );
26
+ * editor.plugins.get( 'AnnotationsUIs' ).activate( 'inline', filter );
27
+ * ```
28
+ *
29
+ * See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
30
+ */
31
+ export default class InlineAnnotations extends Plugin implements AnnotationsUI<Plugin> {
32
+ /**
33
+ * An active annotation tracked by this UI.
34
+ *
35
+ * @observable
36
+ */
37
+ activeAnnotation: Annotation | null;
38
+ isAttached: boolean;
39
+ /**
40
+ * A collection of annotations controlled by this UI.
41
+ *
42
+ * This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
43
+ *
44
+ * It is set to `null` if `InlineAnnotations` is not
45
+ * {@link module:comments/annotations/inlineannotations~InlineAnnotations#attach attached}.
46
+ */
47
+ annotations: AnnotationCollection | null;
48
+ /**
49
+ * @inheritDoc
50
+ */
51
+ static get requires(): PluginDependencies;
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ static get pluginName(): 'InlineAnnotations';
56
+ /**
57
+ * @inheritDoc
58
+ */
59
+ constructor(editor: Editor);
60
+ /**
61
+ * @inheritDoc
62
+ */
63
+ init(): void;
64
+ /**
65
+ * @inheritDoc
66
+ */
67
+ afterInit(): void;
68
+ /**
69
+ * Sets the active annotation for this UI.
70
+ */
71
+ setActiveAnnotation(annotation: Annotation | null): void;
72
+ /**
73
+ * @inheritDoc
74
+ */
75
+ attach(annotations: AnnotationCollection): void;
76
+ /**
77
+ * @inheritDoc
78
+ */
79
+ detach(): void;
80
+ /**
81
+ * @inheritDoc
82
+ */
83
+ destroy(): void;
84
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x40b7=['_getBalloonTargetForAnnotation','from','view','_removeAnnotationFromBalloon','editing','EditorAnnotations','left','_balloon','width','_addAnnotationToBalloon','right','clear','init','editor','switchTo','update','activeAnnotation','fromRect','getByView','push','inline','focusTracker','bind','destroy','InlineAnnotations','_addedAnnotations','_manuallyClosed','plugins','register','getClientRects','change:isFocused','setActiveAnnotation','hasActive','context','detach','stopListening','_selectedAnnotations','targetRect','getBoundingClientRect','inlineannotations-detach-not-attached','delete','_setSelectedAnnotations','hasView','_forceRefresh','isActive','change:height','isFocused','add','refresh','collapse','domConverter','isAttached','target','_closeAnnotation','focus','top','viewRangeToDom','map','inlineannotations-not-allowed-with-context','document','getOrderedSelectedAnnotations','blur','get','includes','editableElement','remove','length','getFirstRange','addObserver','has','bottom','updatePosition','Esc','annotations','mousedown','set','listenTo','change:visibleView','visibleView','requires'];(function(_0x54c76e,_0x40b76e){const _0x38ef2d=function(_0x424850){while(--_0x424850){_0x54c76e['push'](_0x54c76e['shift']());}};_0x38ef2d(++_0x40b76e);}(_0x40b7,0x1c8));const _0x38ef=function(_0x54c76e,_0x40b76e){_0x54c76e=_0x54c76e-0x0;let _0x38ef2d=_0x40b7[_0x54c76e];return _0x38ef2d;};import{Plugin as _0x18bedf}from'ckeditor5/src/core';import _0x2f6758 from'./annotationsuis';import _0xe0051d from'./editorannotations';import{ContextualBalloon as _0x398762}from'ckeditor5/src/ui';import{MouseObserver as _0x3ba011}from'ckeditor5/src/engine';import{CKEditorError as _0x411c6e,Rect as _0x5361ff}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class a extends _0x18bedf{static get[_0x38ef('0x17')](){return[_0xe0051d,_0x398762,_0x2f6758];}static get['pluginName'](){return _0x38ef('0x30');}constructor(_0x1dabc5){super(_0x1dabc5),_0x1dabc5[_0x38ef('0x1c')][_0x38ef('0x1a')][_0x38ef('0xc')](_0x3ba011),this[_0x38ef('0x4b')]=!0x1,this[_0x38ef('0x13')](_0x38ef('0x28'),null),this[_0x38ef('0x11')]=null,this[_0x38ef('0x32')]=new Set(),this[_0x38ef('0x1f')]=_0x1dabc5[_0x38ef('0x33')]['get'](_0x398762),this[_0x38ef('0x31')]=new Set(),this['_selectedAnnotations']=[],this[_0x38ef('0x43')]=!0x1;}[_0x38ef('0x24')](){const _0xd93ce5=this[_0x38ef('0x25')]['plugins'][_0x38ef('0x6')](_0x2f6758);_0xd93ce5[_0x38ef('0x39')]===this[_0x38ef('0x25')]&&(_0xd93ce5[_0x38ef('0x34')]('inline',this),this[_0x38ef('0x25')]['keystrokes'][_0x38ef('0x13')](_0x38ef('0x10'),(_0x1f32b4,_0x4fd8dc)=>{const _0x1e5f44=this[_0x38ef('0x1f')];if(this[_0x38ef('0x4b')]&&_0x1e5f44[_0x38ef('0x16')]){const _0x3f9441=this[_0x38ef('0x11')][_0x38ef('0x2a')](_0x1e5f44[_0x38ef('0x16')]);this[_0x38ef('0x4d')](_0x3f9441),_0x4fd8dc();}}));}['afterInit'](){const _0xa74c34=this[_0x38ef('0x25')][_0x38ef('0x33')][_0x38ef('0x6')](_0x2f6758);_0xa74c34['context']===this[_0x38ef('0x25')]&&(_0xa74c34[_0x38ef('0x38')]()||_0xa74c34[_0x38ef('0x26')](_0x38ef('0x2c')));}[_0x38ef('0x37')](_0x436e02){_0x436e02!==this[_0x38ef('0x28')]&&(this[_0x38ef('0x28')]&&(this['activeAnnotation']['isActive']=!0x1),_0x436e02&&this['editor']['ui'][_0x38ef('0x2d')][_0x38ef('0x46')]&&(this['_addAnnotationToBalloon'](_0x436e02,!0x0),_0x436e02[_0x38ef('0x44')]=!0x0),_0x436e02||this[_0x38ef('0x41')]([]),this[_0x38ef('0x28')]=_0x436e02);}['attach'](_0x5b18f1){this['annotations']=_0x5b18f1;const _0x73c722=this[_0x38ef('0x25')][_0x38ef('0x33')][_0x38ef('0x6')](_0x2f6758),_0x1a9c99=this['_balloon'];if(this[_0x38ef('0x4b')])throw new _0x411c6e('inlineannotations-attach-already-attached',this);if(_0x73c722['context']!==this[_0x38ef('0x25')])throw new _0x411c6e(_0x38ef('0x2'),this);const _0x5cda68=this[_0x38ef('0x25')][_0x38ef('0x33')][_0x38ef('0x6')](_0x38ef('0x1d'));this[_0x38ef('0x14')](_0x5cda68,_0x38ef('0x48'),function(){const _0x115afe=_0x5cda68[_0x38ef('0x4')]({'activeAnnotation':this[_0x38ef('0x28')],'annotations':this[_0x38ef('0x11')]});if(!this[_0x38ef('0x43')]&&(_0x33ced5=_0x115afe,_0x6f6dc0=this[_0x38ef('0x3c')],_0x33ced5[_0x38ef('0xa')]===_0x6f6dc0[_0x38ef('0xa')]&&_0x33ced5['every'](_0x5d038e=>_0x6f6dc0[_0x38ef('0x7')](_0x5d038e))))return;var _0x33ced5,_0x6f6dc0;this[_0x38ef('0x43')]=!0x1,this[_0x38ef('0x41')](_0x115afe),this['setActiveAnnotation'](_0x115afe[0x0]||null);}[_0x38ef('0x2e')](this)),this['listenTo'](_0x5cda68,_0x38ef('0x5'),(_0x368d26,{isAnnotationTracked:_0x20c005})=>{this[_0x38ef('0x28')]&&_0x20c005(this[_0x38ef('0x28')])&&(this[_0x38ef('0x41')]([]),this['setActiveAnnotation'](null));}),this[_0x38ef('0x14')](this['editor']['ui'][_0x38ef('0x2d')],_0x38ef('0x36'),(_0x341bf5,_0x3679b7,_0x50af51)=>{_0x50af51||this['setActiveAnnotation'](null);}),this[_0x38ef('0x14')](_0x5b18f1,_0x38ef('0x9'),(_0xf19305,_0x3e1674)=>{this[_0x38ef('0x1b')](_0x3e1674),_0x3e1674===this[_0x38ef('0x28')]&&this[_0x38ef('0x37')](null);}),this[_0x38ef('0x14')](_0x1a9c99,_0x38ef('0x15'),(_0x9c8f88,_0xc2aaaf,_0x29a3e6,_0x665785)=>{if(_0x665785&&this[_0x38ef('0x3b')](_0x665785),!_0x29a3e6||!_0x5b18f1[_0x38ef('0x2a')](_0x29a3e6))return;const _0x265384=_0x5b18f1[_0x38ef('0x2a')](_0x29a3e6);this['listenTo'](_0x29a3e6,_0x38ef('0x45'),()=>{_0x1a9c99['updatePosition']();}),this[_0x38ef('0x14')](_0x29a3e6,'Esc',()=>{this[_0x38ef('0x4d')](_0x265384),this['editor'][_0x38ef('0x1c')][_0x38ef('0x1a')][_0x38ef('0x4e')]();}),this[_0x38ef('0x28')]!==_0x265384&&this['setActiveAnnotation'](_0x265384);}),this[_0x38ef('0x14')](this['editor']['ui'],_0x38ef('0x27'),()=>{_0x1a9c99['visibleView']&&(_0x5b18f1[_0x38ef('0x2a')](_0x1a9c99[_0x38ef('0x16')])&&_0x1a9c99[_0x38ef('0xf')]());}),this[_0x38ef('0x14')](this[_0x38ef('0x25')]['editing'][_0x38ef('0x1a')][_0x38ef('0x3')],_0x38ef('0x12'),()=>{this[_0x38ef('0x43')]=!0x0,this[_0x38ef('0x32')][_0x38ef('0x23')]();}),this[_0x38ef('0x25')][_0x38ef('0x1c')][_0x38ef('0x1a')][_0x38ef('0x3')]['selection'][_0x38ef('0x8')]&&this[_0x38ef('0x25')][_0x38ef('0x1c')][_0x38ef('0x1a')][_0x38ef('0x4e')](),this[_0x38ef('0x4b')]=!0x0;}[_0x38ef('0x3a')](){if(!this['isAttached'])throw new _0x411c6e(_0x38ef('0x3f'),this);this['setActiveAnnotation'](null);for(const _0x360fae of this[_0x38ef('0x31')])this[_0x38ef('0x1b')](_0x360fae);this[_0x38ef('0x3b')](),this['isAttached']=!0x1,this[_0x38ef('0x11')]=null;}[_0x38ef('0x2f')](){this[_0x38ef('0x4b')]&&this[_0x38ef('0x3a')]();}[_0x38ef('0x41')](_0x31568b){for(const _0x817894 of this[_0x38ef('0x3c')])_0x31568b[_0x38ef('0x7')](_0x817894)||this['_manuallyClosed']['delete'](_0x817894);for(const _0x3be14f of this[_0x38ef('0x11')])_0x31568b[_0x38ef('0x7')](_0x3be14f)||this[_0x38ef('0x1b')](_0x3be14f);if(this[_0x38ef('0x25')]['ui'][_0x38ef('0x2d')][_0x38ef('0x46')])for(const _0x4aa4dd of _0x31568b)this[_0x38ef('0x21')](_0x4aa4dd);this['_selectedAnnotations']=_0x31568b;}[_0x38ef('0x21')](_0x3cdc31,_0x19359b){this['_manuallyClosed'][_0x38ef('0xd')](_0x3cdc31)||(this[_0x38ef('0x31')][_0x38ef('0xd')](_0x3cdc31)||this[_0x38ef('0x1f')][_0x38ef('0x42')](_0x3cdc31[_0x38ef('0x1a')])||(this[_0x38ef('0x31')][_0x38ef('0x47')](_0x3cdc31),this[_0x38ef('0x1f')][_0x38ef('0x47')]({'stackId':_0x3cdc31[_0x38ef('0x1a')]['id'],'view':_0x3cdc31[_0x38ef('0x1a')],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x3cdc31)}})),_0x19359b&&this[_0x38ef('0x1f')]['showStack'](_0x3cdc31[_0x38ef('0x1a')]['id']));}[_0x38ef('0x18')](_0x3b1c4d){const _0xa38207=_0x3b1c4d[_0x38ef('0x4c')],_0x3ecb4e=this[_0x38ef('0x25')]['editing']['view'],_0x42549a=_0x3ecb4e[_0x38ef('0x3')]['selection'][_0x38ef('0xb')](),_0x13c74f=_0x3ecb4e[_0x38ef('0x4a')][_0x38ef('0x0')](_0x42549a);if(_0x13c74f[_0x38ef('0x49')](!0x0),_0xa38207){if(_0xa38207 instanceof _0x5361ff)return _0xa38207;let _0x117bd1=[];for(const _0x3e8d9c of _0xa38207)_0x117bd1[_0x38ef('0x2b')](...(_0x12476c=_0x3e8d9c[_0x38ef('0x35')](),Array[_0x38ef('0x19')](_0x12476c)[_0x38ef('0x1')](DOMRect[_0x38ef('0x29')])));_0x117bd1=function(_0x4606e2){const _0x8c0c4=[];let _0x42b478=_0x4606e2[0x0];for(let _0x180e25=0x1;_0x180e25<_0x4606e2[_0x38ef('0xa')];_0x180e25++)E(_0x42b478,_0x4606e2[_0x180e25])?_0x42b478['width']+=_0x4606e2[_0x180e25][_0x38ef('0x20')]:(_0x8c0c4['push'](_0x42b478),_0x42b478=_0x4606e2[_0x180e25]);return _0x8c0c4['push'](_0x42b478),_0x8c0c4;}(_0x117bd1);const _0x5f0da0=_0x13c74f[_0x38ef('0x3e')]();return _0x117bd1['find'](_0x37d6ab=>_0x37d6ab[_0x38ef('0x4f')]<=_0x5f0da0[_0x38ef('0x4f')]&&_0x37d6ab['bottom']>=_0x5f0da0[_0x38ef('0xe')]&&_0x37d6ab[_0x38ef('0x1e')]<=_0x5f0da0[_0x38ef('0x1e')]&&_0x37d6ab[_0x38ef('0x22')]>=_0x5f0da0[_0x38ef('0x22')])||_0x117bd1[0x0];}var _0x12476c;return _0x3b1c4d[_0x38ef('0x3d')]||_0x13c74f;}[_0x38ef('0x1b')](_0x36d5d1){this['_addedAnnotations'][_0x38ef('0xd')](_0x36d5d1)&&this[_0x38ef('0x1f')][_0x38ef('0x42')](_0x36d5d1[_0x38ef('0x1a')])&&(this[_0x38ef('0x31')][_0x38ef('0x40')](_0x36d5d1),this[_0x38ef('0x1f')]['remove'](_0x36d5d1[_0x38ef('0x1a')]));}[_0x38ef('0x4d')](_0x3043a3){this[_0x38ef('0x32')][_0x38ef('0x47')](_0x3043a3),this['_removeAnnotationFromBalloon'](_0x3043a3);}}function E(_0x8fd043,_0x1cab75){return _0x8fd043[_0x38ef('0x4f')]===_0x1cab75[_0x38ef('0x4f')]&&_0x8fd043['bottom']===_0x1cab75[_0x38ef('0xe')]&&_0x8fd043[_0x38ef('0x22')]===_0x1cab75[_0x38ef('0x1e')];}
23
+ const _0x171d=['hasView','focusTracker','collapse','domConverter','annotations','_removeAnnotationFromBalloon','_balloon','change:isFocused','push','activeAnnotation','inlineannotations-not-allowed-with-context','_forceRefresh','_addAnnotationToBalloon','blur','register','updatePosition','focus','update','fromRect','switchTo','keystrokes','destroy','listenTo','isFocused','width','map','left','top','includes','clear','getClientRects','stopListening','getByView','selection','set','hasActive','_setSelectedAnnotations','afterInit','has','viewRangeToDom','visibleView','addObserver','document','refresh','editing','inline','pluginName','editor','init','_closeAnnotation','right','delete','inlineannotations-attach-already-attached','_getBalloonTargetForAnnotation','view','from','editableElement','context','length','_addedAnnotations','add','detach','remove','isAttached','getOrderedSelectedAnnotations','setActiveAnnotation','requires','getFirstRange','get','_selectedAnnotations','Esc','targetRect','_manuallyClosed','plugins','bottom'];(function(_0x273781,_0x171dc5){const _0x5b0fbc=function(_0x176ad3){while(--_0x176ad3){_0x273781['push'](_0x273781['shift']());}};_0x5b0fbc(++_0x171dc5);}(_0x171d,0x108));const _0x5b0f=function(_0x273781,_0x171dc5){_0x273781=_0x273781-0x0;let _0x5b0fbc=_0x171d[_0x273781];return _0x5b0fbc;};import{Plugin as _0x2a21b0}from'ckeditor5/src/core';import _0x506609 from'./annotationsuis';import _0x15b0f5 from'./editorannotations';import{ContextualBalloon as _0xe9219}from'ckeditor5/src/ui';import{MouseObserver as _0x15ca21}from'ckeditor5/src/engine';import{CKEditorError as _0x1ebf5c,Rect as _0x2bb842}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x2a21b0{static get[_0x5b0f('0x1b')](){return[_0x15b0f5,_0xe9219,_0x506609];}static get[_0x5b0f('0x7')](){return'InlineAnnotations';}constructor(_0x166712){super(_0x166712),_0x166712[_0x5b0f('0x5')][_0x5b0f('0xf')][_0x5b0f('0x2')](_0x15ca21),this['isAttached']=!0x1,this[_0x5b0f('0x46')](_0x5b0f('0x2d'),null),this['annotations']=null,this[_0x5b0f('0x21')]=new Set(),this[_0x5b0f('0x2a')]=_0x166712[_0x5b0f('0x22')][_0x5b0f('0x1d')](_0xe9219),this[_0x5b0f('0x14')]=new Set(),this[_0x5b0f('0x1e')]=[],this[_0x5b0f('0x2f')]=!0x1;}[_0x5b0f('0x9')](){const _0x8afe8e=this['editor'][_0x5b0f('0x22')]['get'](_0x506609);_0x8afe8e[_0x5b0f('0x12')]===this[_0x5b0f('0x8')]&&(_0x8afe8e[_0x5b0f('0x32')](_0x5b0f('0x6'),this),this[_0x5b0f('0x8')][_0x5b0f('0x38')][_0x5b0f('0x46')](_0x5b0f('0x1f'),(_0x44eca4,_0x598aef)=>{const _0x393252=this['_balloon'];if(this['isAttached']&&_0x393252[_0x5b0f('0x1')]){const _0x9bf357=this[_0x5b0f('0x28')][_0x5b0f('0x44')](_0x393252[_0x5b0f('0x1')]);_0x9bf357&&this['_closeAnnotation'](_0x9bf357),_0x598aef();}}));}[_0x5b0f('0x49')](){const _0x28f9a8=this[_0x5b0f('0x8')][_0x5b0f('0x22')]['get'](_0x506609);_0x28f9a8[_0x5b0f('0x12')]===this['editor']&&(_0x28f9a8[_0x5b0f('0x47')]()||_0x28f9a8[_0x5b0f('0x37')](_0x5b0f('0x6')));}['setActiveAnnotation'](_0x2d8212){_0x2d8212!==this[_0x5b0f('0x2d')]&&(this[_0x5b0f('0x2d')]&&(this['activeAnnotation']['isActive']=!0x1),_0x2d8212&&this[_0x5b0f('0x8')]['ui'][_0x5b0f('0x25')][_0x5b0f('0x3b')]&&(this['annotations'][_0x5b0f('0x4a')](_0x2d8212)&&this[_0x5b0f('0x30')](_0x2d8212,!0x0),_0x2d8212['isActive']=!0x0),_0x2d8212||this[_0x5b0f('0x48')]([]),this[_0x5b0f('0x2d')]=_0x2d8212);}['attach'](_0x19b982){this['annotations']=_0x19b982;const _0x6f4150=this[_0x5b0f('0x8')][_0x5b0f('0x22')][_0x5b0f('0x1d')](_0x506609),_0x17cff8=this[_0x5b0f('0x2a')];if(this['isAttached'])throw new _0x1ebf5c(_0x5b0f('0xd'),this);if(_0x6f4150[_0x5b0f('0x12')]!==this[_0x5b0f('0x8')])throw new _0x1ebf5c(_0x5b0f('0x2e'),this);const _0x320368=this[_0x5b0f('0x8')][_0x5b0f('0x22')][_0x5b0f('0x1d')](_0x15b0f5);this[_0x5b0f('0x3a')](_0x320368,_0x5b0f('0x4'),()=>{const _0x5afcc0=_0x320368[_0x5b0f('0x19')]({'annotations':this[_0x5b0f('0x28')],'activeAnnotation':this['activeAnnotation']});var _0x3bc030,_0x59a78c;!this[_0x5b0f('0x2f')]&&(_0x3bc030=_0x5afcc0,_0x59a78c=this[_0x5b0f('0x1e')],_0x3bc030[_0x5b0f('0x13')]===_0x59a78c[_0x5b0f('0x13')]&&_0x3bc030['every'](_0x4930d7=>_0x59a78c[_0x5b0f('0x40')](_0x4930d7)))||(this[_0x5b0f('0x2f')]=!0x1,this['_setSelectedAnnotations'](_0x5afcc0),this[_0x5b0f('0x1a')](_0x5afcc0[0x0]||null));}),this[_0x5b0f('0x3a')](_0x320368,_0x5b0f('0x31'),(_0x25ee74,{isAnnotationTracked:_0x22ee03})=>{this[_0x5b0f('0x2d')]&&_0x22ee03(this[_0x5b0f('0x2d')])&&(this['_setSelectedAnnotations']([]),this[_0x5b0f('0x1a')](null));}),this[_0x5b0f('0x3a')](this[_0x5b0f('0x8')]['ui'][_0x5b0f('0x25')],_0x5b0f('0x2b'),(_0x3aeae6,_0x476ac8,_0x4f5158)=>{_0x4f5158||this['setActiveAnnotation'](null);}),this[_0x5b0f('0x3a')](_0x19b982,_0x5b0f('0x17'),(_0xc462a4,_0x3f7e14)=>{this[_0x5b0f('0x29')](_0x3f7e14),_0x3f7e14===this[_0x5b0f('0x2d')]&&this[_0x5b0f('0x1a')](null);}),this[_0x5b0f('0x3a')](_0x17cff8,'change:visibleView',(_0x865fcd,_0x256638,_0x484ff3,_0x532a29)=>{_0x532a29&&this[_0x5b0f('0x43')](_0x532a29);const _0x448749=_0x19b982[_0x5b0f('0x44')](_0x484ff3);_0x484ff3&&_0x448749&&(this[_0x5b0f('0x3a')](_0x484ff3,'change:height',()=>{_0x17cff8[_0x5b0f('0x33')]();}),this[_0x5b0f('0x3a')](_0x484ff3,_0x5b0f('0x1f'),()=>{this['_closeAnnotation'](_0x448749),this['editor'][_0x5b0f('0x5')][_0x5b0f('0xf')][_0x5b0f('0x34')]();}),this[_0x5b0f('0x2d')]!==_0x448749&&this[_0x5b0f('0x1a')](_0x448749));}),this[_0x5b0f('0x3a')](this[_0x5b0f('0x8')]['ui'],_0x5b0f('0x35'),()=>{_0x17cff8[_0x5b0f('0x1')]&&(_0x19b982[_0x5b0f('0x44')](_0x17cff8['visibleView'])&&_0x17cff8[_0x5b0f('0x33')]());}),this[_0x5b0f('0x3a')](this[_0x5b0f('0x8')]['editing'][_0x5b0f('0xf')][_0x5b0f('0x3')],'mousedown',()=>{this[_0x5b0f('0x2f')]=!0x0,this['_manuallyClosed'][_0x5b0f('0x41')]();}),this['editor'][_0x5b0f('0x5')][_0x5b0f('0xf')][_0x5b0f('0x3')][_0x5b0f('0x45')][_0x5b0f('0x11')]&&this[_0x5b0f('0x8')][_0x5b0f('0x5')][_0x5b0f('0xf')][_0x5b0f('0x34')](),this[_0x5b0f('0x18')]=!0x0;}['detach'](){if(!this[_0x5b0f('0x18')])throw new _0x1ebf5c('inlineannotations-detach-not-attached',this);this[_0x5b0f('0x1a')](null);for(const _0x990a1c of this[_0x5b0f('0x14')])this['_removeAnnotationFromBalloon'](_0x990a1c);this[_0x5b0f('0x43')](),this[_0x5b0f('0x18')]=!0x1,this[_0x5b0f('0x28')]=null;}[_0x5b0f('0x39')](){this[_0x5b0f('0x18')]&&this[_0x5b0f('0x16')]();}[_0x5b0f('0x48')](_0xaac4f4){for(const _0x174f68 of this[_0x5b0f('0x1e')])_0xaac4f4['includes'](_0x174f68)||this[_0x5b0f('0x21')][_0x5b0f('0xc')](_0x174f68);for(const _0x20c541 of this[_0x5b0f('0x28')])_0xaac4f4[_0x5b0f('0x40')](_0x20c541)||this[_0x5b0f('0x29')](_0x20c541);if(this[_0x5b0f('0x8')]['ui'][_0x5b0f('0x25')][_0x5b0f('0x3b')])for(const _0x138fc4 of _0xaac4f4)this[_0x5b0f('0x30')](_0x138fc4);this[_0x5b0f('0x1e')]=_0xaac4f4;}[_0x5b0f('0x30')](_0x19c8d1,_0xbf7abd=!0x1){this['_manuallyClosed'][_0x5b0f('0x4a')](_0x19c8d1)||(this[_0x5b0f('0x14')][_0x5b0f('0x4a')](_0x19c8d1)||this[_0x5b0f('0x2a')]['hasView'](_0x19c8d1[_0x5b0f('0xf')])||(this['_addedAnnotations'][_0x5b0f('0x15')](_0x19c8d1),this[_0x5b0f('0x2a')][_0x5b0f('0x15')]({'stackId':_0x19c8d1[_0x5b0f('0xf')]['id'],'view':_0x19c8d1[_0x5b0f('0xf')],'position':{'target':()=>this[_0x5b0f('0xe')](_0x19c8d1)}})),_0xbf7abd&&this['_balloon']['showStack'](_0x19c8d1[_0x5b0f('0xf')]['id']));}[_0x5b0f('0xe')](_0x30c455){const _0x34b11a=_0x30c455['target'],_0x492ce7=this[_0x5b0f('0x8')]['editing'][_0x5b0f('0xf')],_0x1581fe=_0x492ce7[_0x5b0f('0x3')][_0x5b0f('0x45')][_0x5b0f('0x1c')](),_0x5641b4=_0x492ce7[_0x5b0f('0x27')][_0x5b0f('0x0')](_0x1581fe);if(_0x5641b4[_0x5b0f('0x26')](!0x0),_0x34b11a){if(_0x34b11a instanceof _0x2bb842)return _0x34b11a;let _0x4f1eca=[];for(const _0x2e6c24 of _0x34b11a)_0x4f1eca['push'](...(_0x70fd4d=_0x2e6c24[_0x5b0f('0x42')](),Array[_0x5b0f('0x10')](_0x70fd4d)[_0x5b0f('0x3d')](DOMRect[_0x5b0f('0x36')])));_0x4f1eca=function(_0x3049fc){const _0x408cf5=[];let _0x45cdb3=_0x3049fc[0x0];for(let _0x14ab8f=0x1;_0x14ab8f<_0x3049fc[_0x5b0f('0x13')];_0x14ab8f++)F(_0x45cdb3,_0x3049fc[_0x14ab8f])?_0x45cdb3['width']+=_0x3049fc[_0x14ab8f][_0x5b0f('0x3c')]:(_0x408cf5[_0x5b0f('0x2c')](_0x45cdb3),_0x45cdb3=_0x3049fc[_0x14ab8f]);return _0x408cf5['push'](_0x45cdb3),_0x408cf5;}(_0x4f1eca);const _0x4368c3=_0x5641b4['getBoundingClientRect']();return _0x4f1eca['find'](_0x313a74=>_0x313a74['top']<=_0x4368c3[_0x5b0f('0x3f')]&&_0x313a74[_0x5b0f('0x23')]>=_0x4368c3['bottom']&&_0x313a74[_0x5b0f('0x3e')]<=_0x4368c3['left']&&_0x313a74[_0x5b0f('0xb')]>=_0x4368c3[_0x5b0f('0xb')])||_0x4f1eca[0x0];}var _0x70fd4d;return _0x30c455[_0x5b0f('0x20')]||_0x5641b4;}[_0x5b0f('0x29')](_0x1257a6){this[_0x5b0f('0x14')]['has'](_0x1257a6)&&this['_balloon'][_0x5b0f('0x24')](_0x1257a6['view'])&&(this['_addedAnnotations'][_0x5b0f('0xc')](_0x1257a6),this[_0x5b0f('0x2a')]['remove'](_0x1257a6[_0x5b0f('0xf')]));}[_0x5b0f('0xa')](_0x16fb4d){this[_0x5b0f('0x21')]['add'](_0x16fb4d),this[_0x5b0f('0x29')](_0x16fb4d);}}function F(_0x3abd2e,_0x4b66e2){return _0x3abd2e[_0x5b0f('0x3f')]===_0x4b66e2[_0x5b0f('0x3f')]&&_0x3abd2e[_0x5b0f('0x23')]===_0x4b66e2[_0x5b0f('0x23')]&&_0x3abd2e[_0x5b0f('0xb')]===_0x4b66e2['left'];}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @module comments/annotations/narrowsidebar
3
+ * @publicApi
4
+ */
5
+ import { ContextPlugin, Context, type ContextPluginDependencies, type Editor } from 'ckeditor5/src/core';
6
+ import { type AnnotationsUI } from './annotationsuis';
7
+ import { BalloonPanelView, BodyCollection } from 'ckeditor5/src/ui';
8
+ import '../../theme/sidebar-narrow.css';
9
+ import type Annotation from './annotation';
10
+ import type AnnotationCollection from './annotationcollection';
11
+ /**
12
+ * The narrow sidebar UI for displaying annotations.
13
+ *
14
+ * Binds {@link module:comments/annotations/annotations~Annotations} plugin with
15
+ * {@link module:comments/annotations/sidebar~Sidebar} plugin to display annotations in the sidebar as
16
+ * {@link module:comments/annotations/view/annotationcounterbuttonview~AnnotationCounterButtonView small icons}.
17
+ *
18
+ * After selecting an annotation the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} with an
19
+ * {@link module:comments/annotations/view/annotationview~AnnotationView} appears attached to the sidebar item.
20
+ *
21
+ * This UI is intended for medium-sized viewports.
22
+ *
23
+ * To activate this UI use one of the following:
24
+ *
25
+ * ```ts
26
+ * editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'narrowSidebar' );
27
+ * editor.plugins.get( 'AnnotationsUIs' ).activate( 'narrowSidebar', filter );
28
+ * ```
29
+ *
30
+ * See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
31
+ */
32
+ export default class NarrowSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
33
+ /**
34
+ * An active annotation tracked by this UI.
35
+ */
36
+ activeAnnotation: Annotation | null;
37
+ bodyCollection: BodyCollection;
38
+ balloonPanelView: BalloonPanelView;
39
+ isAttached: boolean;
40
+ /**
41
+ * A collection of annotations controlled by this UI.
42
+ *
43
+ * This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
44
+ *
45
+ * It is set to `null` if `NarrowSidebar` is not {@link module:comments/annotations/narrowsidebar~NarrowSidebar#attach attached}.
46
+ */
47
+ annotations: AnnotationCollection | null;
48
+ /**
49
+ * @inheritDoc
50
+ */
51
+ static get requires(): ContextPluginDependencies;
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ static get pluginName(): 'NarrowSidebar';
56
+ /**
57
+ * @inheritDoc
58
+ */
59
+ constructor(context: Context | Editor);
60
+ /**
61
+ * @inheritDoc
62
+ */
63
+ init(): void;
64
+ /**
65
+ * @inheritDoc
66
+ */
67
+ attach(annotations: AnnotationCollection): void;
68
+ /**
69
+ * Sets the active annotation for this UI.
70
+ */
71
+ setActiveAnnotation(annotation: Annotation | null): void;
72
+ /**
73
+ * @inheritDoc
74
+ */
75
+ detach(): void;
76
+ /**
77
+ * @inheritDoc
78
+ */
79
+ destroy(): void;
80
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2101=['activeAnnotation','keyCode','rearrange','destroy','_detachListeners','balloonPanelView','_attachToContainer','setActiveAnnotation','detachFromDom','refresh','_integrateWithEditorAnnotations','isAttached','NarrowSidebar','_refreshPositioningDebounced','hasDomSelection','attach','_domEmitter','high','refreshPositioning','focus','change:container','attachToDom','pin','ready','_destroyEditorAnnotationsIntegration','uiUpdate','plugins','_updateBalloonPosition','_annotations','resize','editors','from','register','annotationType','number','southArrowNorth','detach','execute','add','_editorAnnotations','Sidebar','type','_setSelectedAnnotations','_showBalloon','delete','clear','preventDefault','isDirty','narrowSidebar','narrowsidebar-attach-already-attached','_selectedAnnotations','content','change:height','keydown','stop','context','northArrowSouthWest','preventClosingBalloon','northArrowSouthEast','bodyCollection','length','view','init','EditorAnnotations','isVisible','has','getSidebarItemView','stopListening','set:container','remove','first','getByView','locale','requires','values','_refreshPositioning','mousedown','blur','get','getOrderedSelectedAnnotations','_attachListeners','unpin','contains','annotations','set','_manuallyClosedAnnotationViews','element','southArrowNorthEast','_hideBalloon','defaultPositions','create','removeEventListener','_annotationToNarrowView','listenTo','stopPropagation','low','target'];(function(_0x4ff4d2,_0x210150){const _0x50a65f=function(_0x2455a8){while(--_0x2455a8){_0x4ff4d2['push'](_0x4ff4d2['shift']());}};_0x50a65f(++_0x210150);}(_0x2101,0x1b4));const _0x50a6=function(_0x4ff4d2,_0x210150){_0x4ff4d2=_0x4ff4d2-0x0;let _0x50a65f=_0x2101[_0x4ff4d2];return _0x50a65f;};import{ContextPlugin as _0x26f94f}from'ckeditor5/src/core';import _0x3118b2 from'./annotationsuis';import _0xbd81b9 from'./sidebar';import _0x29d404 from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x4d1e5d,BodyCollection as _0x3c37fa}from'ckeditor5/src/ui';import{CKEditorError as _0x1af5dc,DomEmitterMixin as _0x390e02,keyCodes as _0x26718d,Collection as _0x58ba3a}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x114b9b}from'lodash-es';export default class s extends _0x26f94f{static get[_0x50a6('0x19')](){return[_0xbd81b9,_0x3118b2];}static get['pluginName'](){return _0x50a6('0x3d');}constructor(_0x5729bc){super(_0x5729bc),this[_0x50a6('0x3c')]=!0x1,this[_0x50a6('0x25')]=new Set(),this[_0x50a6('0x41')]=Object[_0x50a6('0x2a')](_0x390e02),this[_0x50a6('0x2c')]=new Map(),this[_0x50a6('0x24')]('activeAnnotation',null),this[_0x50a6('0x23')]=null,this[_0x50a6('0x2')]=[],this[_0x50a6('0x58')]=new _0x58ba3a(),this[_0x50a6('0x3e')]=_0x114b9b(()=>{this[_0x50a6('0x1b')]();},0xfa,{'leading':!0x1});}[_0x50a6('0xe')](){this['context'][_0x50a6('0x4b')][_0x50a6('0x1e')](_0x3118b2)[_0x50a6('0x51')](_0x50a6('0x0'),this),this[_0x50a6('0xb')]=new _0x3c37fa(this[_0x50a6('0x7')][_0x50a6('0x18')]),this[_0x50a6('0x36')]=new _0x4d1e5d(this[_0x50a6('0x7')][_0x50a6('0x18')]),this[_0x50a6('0xb')][_0x50a6('0x46')](),this[_0x50a6('0xb')][_0x50a6('0x57')](this['balloonPanelView']);}[_0x50a6('0x40')](_0x59b2a4){this[_0x50a6('0x23')]=_0x59b2a4;const _0x4efd05=this['context'][_0x50a6('0x4b')][_0x50a6('0x1e')](_0xbd81b9),_0x4d3527=this[_0x50a6('0x36')];if(_0x4efd05[_0x50a6('0x4d')]=_0x59b2a4,this[_0x50a6('0x3c')])throw new _0x1af5dc(_0x50a6('0x1'),this);this[_0x50a6('0x3c')]=!0x0,this[_0x50a6('0x2d')](_0x4efd05,_0x50a6('0x14'),()=>{this['detach'](),this[_0x50a6('0x2d')](_0x4efd05,_0x50a6('0x45'),_0x53d39a=>{_0x53d39a['off'](),this[_0x50a6('0x40')](_0x59b2a4);});}),_0x4efd05[_0x50a6('0x37')]({'viewClass':'ck-sidebar--narrow','spaceBetweenItems':0x5});const _0x29fc69=_0x40ec96=>{const _0x4c2f24=new _0x29d404(this[_0x50a6('0x7')][_0x50a6('0x18')]);_0x4efd05['addAnnotation'](_0x40ec96,_0x4c2f24),this[_0x50a6('0x2c')]['set'](_0x40ec96,_0x4c2f24),_0x4c2f24['bind'](_0x50a6('0x60'),_0x50a6('0x52'),_0x50a6('0x53'))['to'](_0x40ec96[_0x50a6('0xd')],_0x50a6('0x60'),_0x50a6('0x5a'),_0x50a6('0xc')),_0x4c2f24['on'](_0x50a6('0x56'),()=>{this['_manuallyClosedAnnotationViews'][_0x50a6('0x5e')](),_0x4d3527[_0x50a6('0x3')]['first']!==_0x40ec96['view']?(this[_0x50a6('0x5c')](_0x40ec96),_0x40ec96[_0x50a6('0xd')][_0x50a6('0x26')][_0x50a6('0x44')](),this[_0x50a6('0x38')](_0x40ec96)):this[_0x50a6('0x38')](null);});};for(const _0x2b0174 of _0x59b2a4)_0x29fc69(_0x2b0174);this[_0x50a6('0x2d')](_0x59b2a4,_0x50a6('0x57'),(_0x52a7ea,_0xf12b08)=>{_0x29fc69(_0xf12b08);}),this[_0x50a6('0x2d')](_0x59b2a4,_0x50a6('0x15'),(_0xb026f8,_0xa1fac0,_0x4f4b5e)=>{this[_0x50a6('0x2c')]['get'](_0xa1fac0)['destroy'](),this[_0x50a6('0x2c')]['delete'](_0xa1fac0),_0x4efd05[_0x50a6('0x33')]({'removedAnnotation':_0xa1fac0,'previousAnnotation':_0x59b2a4['get'](_0x4f4b5e-0x1),'nextAnnotation':_0x59b2a4[_0x50a6('0x1e')](_0x4f4b5e+0x1)}),_0xa1fac0===this['activeAnnotation']&&this[_0x50a6('0x38')](null);},{'priority':_0x50a6('0x2f')}),this[_0x50a6('0x2d')](_0x59b2a4,'focus',(_0x2e7afe,_0x50b377)=>{this[_0x50a6('0x38')](_0x50b377);}),this[_0x50a6('0x2d')](_0x59b2a4,_0x50a6('0x1d'),()=>{this[_0x50a6('0x38')](null);}),this[_0x50a6('0x41')][_0x50a6('0x2d')](document,_0x50a6('0x5'),(_0x418143,_0xad62ee)=>{_0xad62ee[_0x50a6('0x32')]===_0x26718d['esc']&&_0x4d3527[_0x50a6('0x10')]&&(this['_manuallyClosedAnnotationViews'][_0x50a6('0x57')](_0x4d3527['content']['first']),this[_0x50a6('0x28')](),_0xad62ee[_0x50a6('0x2e')](),_0xad62ee[_0x50a6('0x5f')]());}),this[_0x50a6('0x41')][_0x50a6('0x2d')](document,_0x50a6('0x1c'),(_0x4e3e81,_0x230db8)=>{const _0x360481=_0x230db8['target'];_0x4d3527['isVisible']&&_0x4d3527[_0x50a6('0x26')][_0x50a6('0x22')](_0x360481)||_0x4efd05[_0x50a6('0xd')][_0x50a6('0x26')][_0x50a6('0x22')](_0x360481)||_0x4e3e81[_0x50a6('0x9')]||(this[_0x50a6('0x25')][_0x50a6('0x5e')](),this['_hideBalloon'](),this[_0x50a6('0x38')](null));});const _0x2638d3=this[_0x50a6('0x7')][_0x50a6('0x4f')]?this[_0x50a6('0x7')][_0x50a6('0x4f')]:new _0x58ba3a([this['context']]);for(const _0x133317 of _0x2638d3)this[_0x50a6('0x3b')](_0x133317);this[_0x50a6('0x2d')](_0x2638d3,'add',(_0x3c51be,_0x3286a4)=>{this['listenTo'](_0x3286a4,_0x50a6('0x48'),()=>{this['_integrateWithEditorAnnotations'](_0x3286a4);});}),this[_0x50a6('0x2d')](_0x2638d3,_0x50a6('0x15'),(_0x260d78,_0x30897c)=>{_0x30897c[_0x50a6('0x4b')]['has'](_0x50a6('0xf'))&&this['_destroyEditorAnnotationsIntegration'](_0x30897c[_0x50a6('0x4b')][_0x50a6('0x1e')](_0x50a6('0xf')));}),window['addEventListener'](_0x50a6('0x4e'),this[_0x50a6('0x3e')]),this[_0x50a6('0x1b')]();}[_0x50a6('0x38')](_0x491c48){if(_0x491c48===this[_0x50a6('0x31')])return;const _0x1c5b1b=this[_0x50a6('0x7')][_0x50a6('0x4b')][_0x50a6('0x1e')](_0x50a6('0x59'));if(_0x1c5b1b[_0x50a6('0x3a')]({'blurredAnnotation':this[_0x50a6('0x31')],'activatedAnnotation':_0x491c48,'disableAnimationOnActivatedAnnotation':!0x0}),_0x491c48)_0x1c5b1b[_0x50a6('0x12')](_0x491c48)?this[_0x50a6('0x5c')](_0x491c48):this[_0x50a6('0x28')]();else this['_hideBalloon']();this[_0x50a6('0x31')]=_0x491c48;}[_0x50a6('0x55')](){if(!this[_0x50a6('0x3c')])throw new _0x1af5dc('narrowsidebar-detach-not-attached',this);this[_0x50a6('0x38')](null);const _0x1e56cb=this[_0x50a6('0x7')][_0x50a6('0x4b')][_0x50a6('0x1e')](_0x50a6('0x59'));this[_0x50a6('0x28')](),Array[_0x50a6('0x50')](this['_annotationToNarrowView'][_0x50a6('0x1a')](),_0x31405d=>_0x31405d[_0x50a6('0x34')]()),this[_0x50a6('0x2c')][_0x50a6('0x5e')](),_0x1e56cb['_detachFromContainer'](this[_0x50a6('0x23')]),this[_0x50a6('0x13')](),this[_0x50a6('0x41')][_0x50a6('0x13')](),this[_0x50a6('0x13')](this['context'][_0x50a6('0x4f')]);for(const _0x209d0d of Array['from'](this[_0x50a6('0x58')]))this[_0x50a6('0x49')](_0x209d0d);window[_0x50a6('0x2b')]('resize',this[_0x50a6('0x3e')]),this[_0x50a6('0x3e')]['cancel'](),this[_0x50a6('0x2')]=[],this[_0x50a6('0x3c')]=!0x1,this[_0x50a6('0x23')]=null;}[_0x50a6('0x34')](){this['isAttached']&&this[_0x50a6('0x55')](),this['bodyCollection'][_0x50a6('0x39')]();}[_0x50a6('0x3b')](_0x5b52a1){const _0x47fc59=_0x5b52a1[_0x50a6('0x4b')][_0x50a6('0x1e')](_0x50a6('0xf')),_0x377211=this[_0x50a6('0x7')]['plugins'][_0x50a6('0x1e')](_0xbd81b9),_0x43d428=this[_0x50a6('0x23')],_0x2e9fa4=this[_0x50a6('0x36')],_0x274473=()=>{const _0x521c97=_0x47fc59[_0x50a6('0x1f')]({'activeAnnotation':this[_0x50a6('0x31')],'annotations':this[_0x50a6('0x23')]});this[_0x50a6('0x5b')](_0x521c97),this[_0x50a6('0x38')](_0x521c97[0x0]||null);};this[_0x50a6('0x2d')](_0x47fc59,_0x50a6('0x3a'),_0x274473),this[_0x50a6('0x2d')](_0x47fc59,_0x50a6('0x1d'),(_0x572926,{isAnnotationTracked:_0x2ae38c})=>{this[_0x50a6('0x31')]&&_0x2ae38c(this[_0x50a6('0x31')])&&(this['_setSelectedAnnotations']([]),this[_0x50a6('0x38')](null));}),this[_0x50a6('0x2d')](_0x47fc59,_0x50a6('0x4a'),()=>{this[_0x50a6('0x3e')]();}),this[_0x50a6('0x2d')](_0x43d428,_0x50a6('0x1d'),_0x30883f=>{_0x47fc59[_0x50a6('0x3f')]()&&_0x30883f[_0x50a6('0x6')]();},{'priority':_0x50a6('0x42')}),this[_0x50a6('0x41')][_0x50a6('0x2d')](document,_0x50a6('0x1c'),(_0x5cc423,_0x3b7e9a)=>{const _0x23b673=_0x3b7e9a[_0x50a6('0x30')];_0x2e9fa4[_0x50a6('0x10')]&&_0x2e9fa4['element'][_0x50a6('0x22')](_0x23b673)||_0x377211[_0x50a6('0xd')][_0x50a6('0x26')]['contains'](_0x23b673)||this[_0x50a6('0x31')]&&_0x47fc59[_0x50a6('0x3f')]()&&(_0x274473(),_0x5cc423[_0x50a6('0x9')]=!0x0);},{'priority':_0x50a6('0x42')}),this[_0x50a6('0x58')][_0x50a6('0x57')](_0x47fc59);}[_0x50a6('0x49')](_0x5ce8b6){_0x5ce8b6&&(this[_0x50a6('0x13')](_0x5ce8b6),this[_0x50a6('0x58')][_0x50a6('0x15')](_0x5ce8b6));}[_0x50a6('0x5b')](_0x59719d){for(const _0x546030 of this[_0x50a6('0x2')])_0x59719d['includes'](_0x546030)||this['_manuallyClosedAnnotationViews'][_0x50a6('0x5d')](_0x546030[_0x50a6('0xd')]);this[_0x50a6('0x2')]=_0x59719d;}[_0x50a6('0x1b')](){const _0x21ea93=this[_0x50a6('0x36')];this[_0x50a6('0x23')][_0x50a6('0x43')](),_0x21ea93['isVisible']&&this['_updateBalloonPosition']();}[_0x50a6('0x5c')](_0x51482f){if(this['_manuallyClosedAnnotationViews'][_0x50a6('0x11')](_0x51482f[_0x50a6('0xd')]))return;const _0x26527b=this[_0x50a6('0x36')][_0x50a6('0x3')][_0x50a6('0x16')];_0x26527b!==_0x51482f[_0x50a6('0xd')]?(_0x26527b&&this['_detachListeners'](_0x26527b),this[_0x50a6('0x20')](_0x51482f[_0x50a6('0xd')]),this[_0x50a6('0x36')][_0x50a6('0x3')][_0x50a6('0x5e')](),this[_0x50a6('0x36')][_0x50a6('0x3')][_0x50a6('0x57')](_0x51482f[_0x50a6('0xd')]),this[_0x50a6('0x4c')]()):this[_0x50a6('0x4c')]();}[_0x50a6('0x4c')](){const _0x535990=this[_0x50a6('0x36')][_0x50a6('0x3')]['first'],_0x1efc9a=this['annotations'][_0x50a6('0x17')](_0x535990);if(!this[_0x50a6('0x2c')][_0x50a6('0x11')](_0x1efc9a))return;const _0x40880b=this[_0x50a6('0x2c')][_0x50a6('0x1e')](_0x1efc9a)[_0x50a6('0x26')],_0x401108=function(){const _0x2c812f=_0x4d1e5d[_0x50a6('0x29')];return[_0x2c812f[_0x50a6('0x27')],_0x2c812f[_0x50a6('0xa')],_0x2c812f[_0x50a6('0x54')],_0x2c812f['northArrowSouth'],_0x2c812f['southArrowNorthWest'],_0x2c812f[_0x50a6('0x8')]];}();this[_0x50a6('0x36')][_0x50a6('0x47')]({'target':_0x40880b,'positions':_0x401108});}[_0x50a6('0x28')](){const _0x54636c=this[_0x50a6('0x36')],_0x5935a7=_0x54636c['content']['first'];_0x5935a7&&(this[_0x50a6('0x35')](_0x5935a7),_0x54636c[_0x50a6('0x21')](),_0x54636c[_0x50a6('0x3')]['clear']());}[_0x50a6('0x20')](_0x57d617){this[_0x50a6('0x2d')](_0x57d617,_0x50a6('0x4'),()=>this['_updateBalloonPosition']()),this['listenTo'](_0x57d617,'Esc',(_0xb1f39,_0x5e3dec)=>{this[_0x50a6('0x25')][_0x50a6('0x57')](_0x57d617),this[_0x50a6('0x28')](),_0x5e3dec();});}[_0x50a6('0x35')](_0x10f8c7){this[_0x50a6('0x13')](_0x10f8c7);}}
23
+ const _0xf1a5=['isVisible','_attachListeners','removeEventListener','first','hasDomSelection','remove','type','number','pin','contains','bodyCollection','clear','focus','getSidebarItemView','_showBalloon','locale','narrowSidebar','_refreshPositioning','from','context','plugins','delete','NarrowSidebar','ck-sidebar--narrow','refresh','view','activeAnnotation','narrowsidebar-detach-not-attached','low','add','attach','element','mousedown','getOrderedSelectedAnnotations','defaultPositions','register','_domEmitter','init','pluginName','annotations','change:height','set','attachToDom','_destroyEditorAnnotationsIntegration','isAttached','detachFromDom','keyCode','bind','_integrateWithEditorAnnotations','balloonPanelView','values','_hideBalloon','uiUpdate','isDirty','includes','_refreshPositioningDebounced','execute','southArrowNorth','listenTo','set:container','blur','_selectedAnnotations','has','getByView','editors','high','EditorAnnotations','addEventListener','ready','_detachListeners','requires','_updateBalloonPosition','length','_manuallyClosedAnnotationViews','_annotationToNarrowView','stopListening','setActiveAnnotation','destroy','detach','northArrowSouthWest','stopPropagation','southArrowNorthWest','_editorAnnotations','get','content','preventClosingBalloon','stop','_setSelectedAnnotations','cancel','addAnnotation','_detachFromContainer'];(function(_0x4d6ab8,_0xf1a514){const _0x3346f2=function(_0x346c51){while(--_0x346c51){_0x4d6ab8['push'](_0x4d6ab8['shift']());}};_0x3346f2(++_0xf1a514);}(_0xf1a5,0x1a9));const _0x3346=function(_0x4d6ab8,_0xf1a514){_0x4d6ab8=_0x4d6ab8-0x0;let _0x3346f2=_0xf1a5[_0x4d6ab8];return _0x3346f2;};import{ContextPlugin as _0x51169e,Context as _0x5eb9f2}from'ckeditor5/src/core';import _0x3b4002 from'./annotationsuis';import _0x13221d from'./sidebar';import _0x468537 from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x5f4f46,BodyCollection as _0xaef4b7}from'ckeditor5/src/ui';import{CKEditorError as _0x5dea2b,DomEmitterMixin as _0x28608b,keyCodes as _0xa79bef,Collection as _0x320e86}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x561547}from'lodash-es';import _0x3a17d2 from'./editorannotations';export default class s extends _0x51169e{static get[_0x3346('0x9')](){return[_0x13221d,_0x3b4002];}static get[_0x3346('0x44')](){return _0x3346('0x34');}constructor(_0x447f7f){super(_0x447f7f),this[_0x3346('0x4a')]=!0x1,this[_0x3346('0xc')]=new Set(),this[_0x3346('0x42')]=Object['create'](_0x28608b),this[_0x3346('0xd')]=new Map(),this[_0x3346('0x47')]('activeAnnotation',null),this[_0x3346('0x45')]=null,this['_selectedAnnotations']=[],this['_editorAnnotations']=new _0x320e86(),this[_0x3346('0x55')]=_0x561547(()=>{this[_0x3346('0x2f')]();},0xfa,{'leading':!0x1});}[_0x3346('0x43')](){this[_0x3346('0x31')][_0x3346('0x32')]['get'](_0x3b4002)[_0x3346('0x41')](_0x3346('0x2e'),this),this[_0x3346('0x28')]=new _0xaef4b7(this['context'][_0x3346('0x2d')]),this['balloonPanelView']=new _0x5f4f46(this[_0x3346('0x31')][_0x3346('0x2d')]),this[_0x3346('0x28')][_0x3346('0x48')](),this[_0x3346('0x28')][_0x3346('0x3b')](this['balloonPanelView']);}[_0x3346('0x3c')](_0x27cfcd){this[_0x3346('0x45')]=_0x27cfcd;const _0x11f09f=this[_0x3346('0x31')][_0x3346('0x32')][_0x3346('0x16')](_0x13221d),_0x5eb279=this[_0x3346('0x4f')];if(_0x11f09f['_annotations']=_0x27cfcd,this['isAttached'])throw new _0x5dea2b('narrowsidebar-attach-already-attached',this);this[_0x3346('0x4a')]=!0x0,this[_0x3346('0x58')](_0x11f09f,_0x3346('0x59'),()=>{this[_0x3346('0x11')](),this[_0x3346('0x58')](_0x11f09f,'change:container',_0x5a6ccb=>{_0x5a6ccb['off'](),this[_0x3346('0x3c')](_0x27cfcd);});}),_0x11f09f['_attachToContainer']({'viewClass':_0x3346('0x35'),'spaceBetweenItems':0x5});const _0x5ec1e7=_0x274204=>{const _0x599fb9=new _0x468537(this[_0x3346('0x31')][_0x3346('0x2d')]);_0x11f09f[_0x3346('0x1c')](_0x274204,_0x599fb9),this['_annotationToNarrowView']['set'](_0x274204,_0x599fb9),_0x599fb9[_0x3346('0x4d')](_0x3346('0x53'),'annotationType',_0x3346('0x25'))['to'](_0x274204[_0x3346('0x37')],_0x3346('0x53'),_0x3346('0x24'),_0x3346('0xb')),_0x599fb9['on'](_0x3346('0x56'),()=>{this[_0x3346('0xc')][_0x3346('0x29')](),_0x5eb279[_0x3346('0x17')]['first']!==_0x274204['view']?(this[_0x3346('0x2c')](_0x274204),_0x274204['view'][_0x3346('0x3d')][_0x3346('0x2a')](),this[_0x3346('0xf')](_0x274204)):this[_0x3346('0xf')](null);});};for(const _0x565ea7 of _0x27cfcd)_0x5ec1e7(_0x565ea7);this['listenTo'](_0x27cfcd,_0x3346('0x3b'),(_0x37ebeb,_0x3e1b39)=>{_0x5ec1e7(_0x3e1b39);}),this['listenTo'](_0x27cfcd,'remove',(_0x2b23b8,_0x53a475,_0x54a3e9)=>{this[_0x3346('0xd')][_0x3346('0x16')](_0x53a475)[_0x3346('0x10')](),this['_annotationToNarrowView'][_0x3346('0x33')](_0x53a475),_0x11f09f['rearrange']({'removedAnnotation':_0x53a475,'previousAnnotation':_0x27cfcd[_0x3346('0x16')](_0x54a3e9-0x1),'nextAnnotation':_0x27cfcd[_0x3346('0x16')](_0x54a3e9+0x1)}),_0x53a475===this['activeAnnotation']&&this[_0x3346('0xf')](null);},{'priority':_0x3346('0x3a')}),this[_0x3346('0x58')](_0x27cfcd,_0x3346('0x2a'),(_0x51a874,_0x94fb53)=>{this['setActiveAnnotation'](_0x94fb53);}),this[_0x3346('0x58')](_0x27cfcd,_0x3346('0x5a'),()=>{this[_0x3346('0xf')](null);}),this[_0x3346('0x42')][_0x3346('0x58')](document,'keydown',(_0x40a3cd,_0x1c31d5)=>{_0x1c31d5[_0x3346('0x4c')]===_0xa79bef['esc']&&_0x5eb279[_0x3346('0x1e')]&&(this[_0x3346('0xc')][_0x3346('0x3b')](_0x5eb279['content'][_0x3346('0x21')]),this[_0x3346('0x51')](),_0x1c31d5[_0x3346('0x13')](),_0x1c31d5['preventDefault']());}),this[_0x3346('0x42')]['listenTo'](document,'mousedown',(_0xea4234,_0xb75954)=>{const _0x158373=_0xb75954['target'];_0x5eb279[_0x3346('0x1e')]&&_0x5eb279[_0x3346('0x3d')][_0x3346('0x27')](_0x158373)||_0x11f09f[_0x3346('0x37')][_0x3346('0x3d')][_0x3346('0x27')](_0x158373)||_0xea4234[_0x3346('0x18')]||(this['_manuallyClosedAnnotationViews'][_0x3346('0x29')](),this[_0x3346('0x51')](),this['setActiveAnnotation'](null));});const _0x566047=this[_0x3346('0x31')]instanceof _0x5eb9f2?this[_0x3346('0x31')][_0x3346('0x3')]:new _0x320e86([this[_0x3346('0x31')]]);for(const _0x40c36b of _0x566047)this['_integrateWithEditorAnnotations'](_0x40c36b);this[_0x3346('0x58')](_0x566047,_0x3346('0x3b'),(_0x50a555,_0x5cc3f7)=>{this['listenTo'](_0x5cc3f7,_0x3346('0x7'),()=>{this[_0x3346('0x4e')](_0x5cc3f7);});}),this[_0x3346('0x58')](_0x566047,_0x3346('0x23'),(_0x34c4e3,_0x339e28)=>{_0x339e28[_0x3346('0x32')][_0x3346('0x1')]('EditorAnnotations')&&this[_0x3346('0x49')](_0x339e28[_0x3346('0x32')][_0x3346('0x16')](_0x3346('0x5')));}),window[_0x3346('0x6')]('resize',this[_0x3346('0x55')]),this[_0x3346('0x2f')]();}[_0x3346('0xf')](_0x58aaf3){if(_0x58aaf3===this[_0x3346('0x38')])return;const _0x362ecf=this[_0x3346('0x31')][_0x3346('0x32')][_0x3346('0x16')](_0x13221d);if(_0x362ecf[_0x3346('0x36')]({'blurredAnnotation':this[_0x3346('0x38')],'activatedAnnotation':_0x58aaf3,'disableAnimationOnActivatedAnnotation':!0x0}),_0x58aaf3)_0x362ecf[_0x3346('0x2b')](_0x58aaf3)?this[_0x3346('0x2c')](_0x58aaf3):this[_0x3346('0x51')]();else this[_0x3346('0x51')]();this[_0x3346('0x38')]=_0x58aaf3;}[_0x3346('0x11')](){if(!this[_0x3346('0x4a')])throw new _0x5dea2b(_0x3346('0x39'),this);this[_0x3346('0xf')](null);const _0x5219ec=this[_0x3346('0x31')]['plugins'][_0x3346('0x16')](_0x13221d);this[_0x3346('0x51')](),Array[_0x3346('0x30')](this[_0x3346('0xd')][_0x3346('0x50')](),_0x130021=>_0x130021[_0x3346('0x10')]()),this[_0x3346('0xd')][_0x3346('0x29')](),_0x5219ec[_0x3346('0x1d')](this[_0x3346('0x45')]),this['stopListening'](),this[_0x3346('0x42')][_0x3346('0xe')](),this[_0x3346('0x31')]instanceof _0x5eb9f2&&this[_0x3346('0xe')](this[_0x3346('0x31')]['editors']);for(const _0x19cdba of Array[_0x3346('0x30')](this[_0x3346('0x15')]))this['_destroyEditorAnnotationsIntegration'](_0x19cdba);window[_0x3346('0x20')]('resize',this[_0x3346('0x55')]),this[_0x3346('0x55')][_0x3346('0x1b')](),this[_0x3346('0x0')]=[],this[_0x3346('0x4a')]=!0x1,this['annotations']=null;}[_0x3346('0x10')](){this['isAttached']&&this[_0x3346('0x11')](),this[_0x3346('0x28')][_0x3346('0x4b')]();}[_0x3346('0x4e')](_0x3157c7){const _0x390853=_0x3157c7[_0x3346('0x32')][_0x3346('0x16')](_0x3a17d2),_0x3db0b7=this['context'][_0x3346('0x32')][_0x3346('0x16')](_0x13221d),_0x5a7f0a=this[_0x3346('0x45')],_0x577618=this[_0x3346('0x4f')],_0x41ee17=()=>{const _0x6e0a91=_0x390853[_0x3346('0x3f')]({'annotations':this[_0x3346('0x45')],'activeAnnotation':this[_0x3346('0x38')]});this[_0x3346('0x1a')](_0x6e0a91),this[_0x3346('0xf')](_0x6e0a91[0x0]||null);};this[_0x3346('0x58')](_0x390853,'refresh',_0x41ee17),this['listenTo'](_0x390853,_0x3346('0x5a'),(_0x17ff91,{isAnnotationTracked:_0x54f99b})=>{this['activeAnnotation']&&_0x54f99b(this[_0x3346('0x38')])&&(this[_0x3346('0x1a')]([]),this[_0x3346('0xf')](null));}),this['listenTo'](_0x390853,_0x3346('0x52'),()=>{this[_0x3346('0x55')]();}),this[_0x3346('0x58')](_0x5a7f0a,_0x3346('0x5a'),_0x1c031f=>{_0x390853[_0x3346('0x22')]()&&_0x1c031f[_0x3346('0x19')]();},{'priority':_0x3346('0x4')}),this[_0x3346('0x58')](this[_0x3346('0x42')],_0x3346('0x3e'),(_0x259217,_0xd435b7)=>{const _0xa6611e=_0xd435b7['target'];_0x577618[_0x3346('0x1e')]&&_0x577618[_0x3346('0x3d')][_0x3346('0x27')](_0xa6611e)||_0x3db0b7['view'][_0x3346('0x3d')][_0x3346('0x27')](_0xa6611e)||this[_0x3346('0x38')]&&_0x390853[_0x3346('0x22')]()&&(_0x41ee17(),_0x259217[_0x3346('0x18')]=!0x0);},{'priority':'high'}),this['_editorAnnotations'][_0x3346('0x3b')](_0x390853);}[_0x3346('0x49')](_0x1afff0){_0x1afff0&&(this[_0x3346('0xe')](_0x1afff0),this[_0x3346('0x15')]['remove'](_0x1afff0));}[_0x3346('0x1a')](_0x2f8728){for(const _0x4df9e1 of this[_0x3346('0x0')])_0x2f8728[_0x3346('0x54')](_0x4df9e1)||this[_0x3346('0xc')][_0x3346('0x33')](_0x4df9e1['view']);this[_0x3346('0x0')]=_0x2f8728;}[_0x3346('0x2f')](){const _0x3c3ed3=this[_0x3346('0x4f')];this['annotations']['refreshPositioning'](),_0x3c3ed3['isVisible']&&this[_0x3346('0xa')]();}['_showBalloon'](_0x2d21e0){if(this['_manuallyClosedAnnotationViews'][_0x3346('0x1')](_0x2d21e0[_0x3346('0x37')]))return;const _0x4bbfba=this[_0x3346('0x4f')][_0x3346('0x17')]['first'];_0x4bbfba!==_0x2d21e0[_0x3346('0x37')]?(_0x4bbfba&&this[_0x3346('0x8')](_0x4bbfba),this[_0x3346('0x1f')](_0x2d21e0['view']),this[_0x3346('0x4f')][_0x3346('0x17')]['clear'](),this[_0x3346('0x4f')][_0x3346('0x17')]['add'](_0x2d21e0[_0x3346('0x37')]),this[_0x3346('0xa')]()):this[_0x3346('0xa')]();}['_updateBalloonPosition'](){const _0x2f1804=this['balloonPanelView'][_0x3346('0x17')][_0x3346('0x21')],_0x1e4b8a=_0x2f1804&&this[_0x3346('0x45')][_0x3346('0x2')](_0x2f1804);if(!_0x1e4b8a||!this[_0x3346('0xd')][_0x3346('0x1')](_0x1e4b8a))return;const _0x2a9cf4=this[_0x3346('0xd')][_0x3346('0x16')](_0x1e4b8a)[_0x3346('0x3d')],_0x44fa14=function(){const _0x2d6b82=_0x5f4f46[_0x3346('0x40')];return[_0x2d6b82['southArrowNorthEast'],_0x2d6b82['northArrowSouthEast'],_0x2d6b82[_0x3346('0x57')],_0x2d6b82['northArrowSouth'],_0x2d6b82[_0x3346('0x14')],_0x2d6b82[_0x3346('0x12')]];}();this[_0x3346('0x4f')][_0x3346('0x26')]({'target':_0x2a9cf4,'positions':_0x44fa14});}[_0x3346('0x51')](){const _0x55dfbc=this['balloonPanelView'],_0x14b797=_0x55dfbc[_0x3346('0x17')][_0x3346('0x21')];_0x14b797&&(this['_detachListeners'](_0x14b797),_0x55dfbc['unpin'](),_0x55dfbc[_0x3346('0x17')][_0x3346('0x29')]());}[_0x3346('0x1f')](_0x563ba9){this[_0x3346('0x58')](_0x563ba9,_0x3346('0x46'),()=>this['_updateBalloonPosition']()),this[_0x3346('0x58')](_0x563ba9,'Esc',(_0x5ac788,_0x33a122)=>{this['_manuallyClosedAnnotationViews'][_0x3346('0x3b')](_0x563ba9),this[_0x3346('0x51')](),_0x33a122();});}[_0x3346('0x8')](_0x5f16a2){this[_0x3346('0xe')](_0x5f16a2);}}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * @module comments/annotations/sidebar
3
+ * @publicApi
4
+ */
5
+ import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
6
+ import type { View } from 'ckeditor5/src/ui';
7
+ import SidebarView from './view/sidebarview';
8
+ import SidebarItemView from './view/sidebaritemview';
9
+ import type Annotation from './annotation';
10
+ /**
11
+ * Displays {@link module:comments/annotations/annotationcollection~AnnotationCollection annotations} inside a sidebar.
12
+ *
13
+ * `Sidebar` provides a {@link module:comments/annotations/view/sidebarview~SidebarView} which can be injected at any place on a website.
14
+ *
15
+ * It's main role is to display and correctly position annotation views added to the sidebar, accordingly to their target elements
16
+ * or `Rect`s.
17
+ *
18
+ * The following plugins use `Sidebar` to provide annotations UI:
19
+ *
20
+ * * {@link module:comments/annotations/widesidebar~WideSidebar}
21
+ * * {@link module:comments/annotations/narrowsidebar~NarrowSidebar}
22
+ *
23
+ * The sidebar plugin introduces {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} which is a wrapper view for
24
+ * {@link module:comments/annotations/view/annotationview~AnnotationView}. It adds an interface needed for positioning views inside
25
+ * the sidebar.
26
+ *
27
+ * Structure of items:
28
+ *
29
+ * |-> SidebarItemView -> AnnotationView -> added View
30
+ * Sidebar#view#list -|-> SidebarItemView -> AnnotationView -> added View
31
+ * |-> ...
32
+ */
33
+ export default class Sidebar extends ContextPlugin {
34
+ /**
35
+ * Container element into which sidebar is injected (in the DOM).
36
+ *
37
+ * @observable
38
+ */
39
+ container: HTMLElement | null;
40
+ /**
41
+ * Sidebar view.
42
+ */
43
+ view: SidebarView;
44
+ /**
45
+ * @inheritDoc
46
+ */
47
+ static get pluginName(): 'Sidebar';
48
+ /**
49
+ * @inheritDoc
50
+ */
51
+ constructor(context: Context | Editor);
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ init(): void;
56
+ /**
57
+ * Sets a new sidebar container.
58
+ */
59
+ setContainer(container: HTMLElement): void;
60
+ /**
61
+ * Rearranges annotations when the annotation is removed.
62
+ */
63
+ rearrange({ removedAnnotation, previousAnnotation, nextAnnotation }: {
64
+ removedAnnotation: Annotation;
65
+ previousAnnotation: Annotation | null;
66
+ nextAnnotation: Annotation | null;
67
+ }): void;
68
+ /**
69
+ * Refreshes sidebar items when one of the annotations is activated.
70
+ *
71
+ * @param options.activatedAnnotation The activated annotation.
72
+ * @param options.blurredAnnotation The previously active annotation.
73
+ * @param options.disableAnimationOnActivatedAnnotation Disables animation on the activated annotation.
74
+ */
75
+ refresh({ blurredAnnotation, activatedAnnotation, disableAnimationOnActivatedAnnotation }: {
76
+ blurredAnnotation: Annotation | null;
77
+ activatedAnnotation: Annotation | null;
78
+ disableAnimationOnActivatedAnnotation?: boolean;
79
+ }): void;
80
+ /**
81
+ * Creates new {@link module:comments/annotations/view/sidebaritemview~SidebarItemView} and binds its
82
+ * position with {@link module:comments/annotations/view/annotationview~AnnotationView} target position.
83
+ *
84
+ * By default, annotation's view will be displayed in the sidebar. However, you can provide any other view
85
+ * to be displayed instead using `annotationToDisplay`. `annotation` will be then used only to gather data needed by `Sidebar`.
86
+ */
87
+ addAnnotation(annotation: Annotation, viewToDisplay?: View): SidebarItemView;
88
+ /**
89
+ * Returns sidebar item view that wraps given annotation view.
90
+ */
91
+ getSidebarItemView(annotation: Annotation): SidebarItemView | undefined;
92
+ /**
93
+ * @inheritDoc
94
+ */
95
+ destroy(): void;
96
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2201=['push','getSidebarItemView','add','addAnnotation','appendChild','refresh','_getMaxAvailableTop','_alignForBottomChange','target','destroy','change:top','_detachFromContainer','setContainer','unbind','length','isAnimationDisabled','top','_getItemBefore','minHeight','sidebar.container','get','_lastItem','_createSidebarView','rearrange','last','_attachToContainer','_targetTop','set','updateHeight','remove','_activeAnnotation','sidebar-attachtocontainer-missing-container','_annotationToSidebarItemView','_spaceBetweenItems','_alignBeforeItem','_destroySidebarItemView','delete','isActive','max','pluginName','list','_getTargetTop','_recalculate','sidebar.preventScrollOutOfView','_recalculateBuffer','render','context','_getItemAfter','object','change:bottom','container','_alignToTargetRect','class','listenTo','_setItemTop','content','view','stopListening','targetRect','getIndex','locale','_alignAfterItem','Sidebar','sidebar-setcontainer-invalid-element','bottom','_updateLastItem','nodeType','_sidebarItemViewToAnnotation','_alignForTopChange','_annotations','init','element','config'];(function(_0x1edbc1,_0x2201dd){const _0xfcb7b6=function(_0x1601e0){while(--_0x1601e0){_0x1edbc1['push'](_0x1edbc1['shift']());}};_0xfcb7b6(++_0x2201dd);}(_0x2201,0xe5));const _0xfcb7=function(_0x1edbc1,_0x2201dd){_0x1edbc1=_0x1edbc1-0x0;let _0xfcb7b6=_0x2201[_0x1edbc1];return _0xfcb7b6;};import{ContextPlugin as _0x3a14b2}from'ckeditor5/src/core';import _0x224b0d from'./view/sidebarview';import _0xe1e09 from'./view/sidebaritemview';import{Rect as _0x314f8d,CKEditorError as _0x169940}from'ckeditor5/src/utils';export default class b extends _0x3a14b2{static get[_0xfcb7('0x1d')](){return _0xfcb7('0x34');}constructor(_0x2f3b93){super(_0x2f3b93),this[_0xfcb7('0x11')](_0xfcb7('0xb')),this['view']=this[_0xfcb7('0xc')](),this[_0xfcb7('0x11')]('container',null),this[_0xfcb7('0x17')]=0x19,this[_0xfcb7('0x39')]=new Map(),this[_0xfcb7('0x16')]=new Map(),this[_0xfcb7('0x24')][_0xfcb7('0x3e')]['define']('sidebar.preventScrollOutOfView',!0x1),this[_0xfcb7('0x3b')]=null,this[_0xfcb7('0x14')]=null,this['_recalculateBuffer']=[];}[_0xfcb7('0x3c')](){const _0xb95e76=this[_0xfcb7('0x24')][_0xfcb7('0x3e')][_0xfcb7('0xa')](_0xfcb7('0x9'));_0xb95e76&&this[_0xfcb7('0x2')](_0xb95e76);}[_0xfcb7('0x2')](_0x28fc59){if(!p(_0x28fc59))throw new _0x169940(_0xfcb7('0x35'));this[_0xfcb7('0x28')]=_0x28fc59;}[_0xfcb7('0xf')]({viewClass:_0x2cb716='',spaceBetweenItems:_0x178b19=0x19}={}){if(!p(this[_0xfcb7('0x28')]))throw new _0x169940(_0xfcb7('0x15'),this);this[_0xfcb7('0x28')][_0xfcb7('0x43')](this[_0xfcb7('0x2e')][_0xfcb7('0x3d')]),this[_0xfcb7('0x2e')][_0xfcb7('0x2a')]=_0x2cb716,this[_0xfcb7('0x17')]=_0x178b19;}[_0xfcb7('0xd')]({removedAnnotation:_0x4cc79c,previousAnnotation:_0x212c0d,nextAnnotation:_0x4e3a1b}){const _0x38dc49=this[_0xfcb7('0x40')](_0x4cc79c);this[_0xfcb7('0x2e')]['list']['remove'](_0x38dc49),this['_destroySidebarItemView'](_0x4cc79c),_0x212c0d&&this[_0xfcb7('0x29')](this[_0xfcb7('0x40')](_0x212c0d)),_0x4e3a1b&&this[_0xfcb7('0x29')](this[_0xfcb7('0x40')](_0x4e3a1b)),this['_updateLastItem']();}[_0xfcb7('0x44')]({blurredAnnotation:_0x4c3bd1,activatedAnnotation:_0x110614,disableAnimationOnActivatedAnnotation:_0x506237}){if(this[_0xfcb7('0x14')]=_0x110614,_0x4c3bd1){_0x4c3bd1['isActive']=!0x1;const _0x2847c3=this['getSidebarItemView'](_0x4c3bd1);_0x2847c3&&_0x506237&&(_0x2847c3[_0xfcb7('0x5')]=!0x1);}if(_0x110614){const _0x363476=this[_0xfcb7('0x40')](_0x110614);_0x363476&&(_0x110614[_0xfcb7('0x1b')]=!0x0,_0x506237&&(_0x363476['isAnimationDisabled']=!0x0,_0x363476[_0xfcb7('0x6')]+=0x1),this[_0xfcb7('0x29')](_0x363476));}}[_0xfcb7('0x1')](_0x32534e){this[_0xfcb7('0x2f')](),this[_0xfcb7('0x2e')]['element'][_0xfcb7('0x13')]();for(const _0x252342 of _0x32534e)this[_0xfcb7('0x19')](_0x252342);this[_0xfcb7('0x2e')][_0xfcb7('0x1e')]['clear'](),this[_0xfcb7('0x2e')][_0xfcb7('0x2a')]='',this[_0xfcb7('0xb')]=null;}[_0xfcb7('0x42')](_0x59b3f5,_0x59f4f3){_0x59f4f3||(_0x59f4f3=_0x59b3f5['view']);const _0x83c881=new _0xe1e09(this['context']['locale']);this['_sidebarItemViewToAnnotation'][_0xfcb7('0x11')](_0x83c881,_0x59b3f5),this[_0xfcb7('0x16')][_0xfcb7('0x11')](_0x59b3f5,_0x83c881),_0x83c881[_0xfcb7('0x2d')][_0xfcb7('0x41')](_0x59f4f3),this[_0xfcb7('0x2b')](_0x59b3f5[_0xfcb7('0x2e')],'change:targetRect',(_0x254266,_0x5eb3ef,_0xc61e1b)=>{const _0x5ea4a5=this[_0xfcb7('0x1f')](_0x59b3f5,_0xc61e1b);_0x83c881[_0xfcb7('0x10')]!=_0x5ea4a5&&(_0x83c881[_0xfcb7('0x10')]=_0x5ea4a5,this[_0xfcb7('0x2c')](_0x83c881,_0x5ea4a5));}),this[_0xfcb7('0x2b')](_0x83c881,_0xfcb7('0x0'),()=>{this[_0xfcb7('0x20')](_0x83c881,'top');}),this[_0xfcb7('0x2b')](_0x83c881,_0xfcb7('0x27'),()=>{this[_0xfcb7('0x20')](_0x83c881,_0xfcb7('0x36'));}),this[_0xfcb7('0x29')](_0x83c881);const _0x307b39=this[_0xfcb7('0x7')](_0x83c881);if(_0x307b39)this[_0xfcb7('0x33')](_0x307b39,_0x83c881)||this['_alignToTargetRect'](_0x83c881);else this[_0xfcb7('0x29')](_0x83c881);return this[_0xfcb7('0x37')](),this['view'][_0xfcb7('0x1e')][_0xfcb7('0x41')](_0x83c881),_0x83c881;}[_0xfcb7('0x3a')](_0x3c17c5){if(!_0x3c17c5[_0xfcb7('0x2d')]['length'])return;const _0x162011=this[_0xfcb7('0x7')](_0x3c17c5);if(!_0x162011)return;const _0x148d37=this[_0xfcb7('0x39')][_0xfcb7('0xa')](_0x162011),_0x413eb2=this[_0xfcb7('0x14')];_0x413eb2&&_0x413eb2===_0x148d37?this['_alignAfterItem'](_0x162011,_0x3c17c5):this[_0xfcb7('0x18')](_0x3c17c5,_0x162011);}['_alignForBottomChange'](_0x5614b8){if(!_0x5614b8[_0xfcb7('0x2d')][_0xfcb7('0x4')])return;const _0x2b8549=this[_0xfcb7('0x25')](_0x5614b8);if(!_0x2b8549)return;const _0x1742a4=this[_0xfcb7('0x39')][_0xfcb7('0xa')](_0x2b8549),_0x31118e=this[_0xfcb7('0x24')][_0xfcb7('0x3e')][_0xfcb7('0xa')](_0xfcb7('0x21')),_0x4d31ea=this[_0xfcb7('0x14')];_0x4d31ea&&_0x4d31ea===_0x1742a4&&_0x31118e?(this[_0xfcb7('0x18')](_0x2b8549,_0x5614b8),this[_0xfcb7('0x33')](_0x5614b8,_0x2b8549)):_0x4d31ea&&_0x4d31ea===_0x1742a4?this[_0xfcb7('0x18')](_0x2b8549,_0x5614b8):this[_0xfcb7('0x33')](_0x5614b8,_0x2b8549);}[_0xfcb7('0x20')](_0x496c3d,_0x1c59c8){0x0===this['_recalculateBuffer'][_0xfcb7('0x4')]&&setTimeout(()=>{for(const {sidebarItemView:_0x5017ea,changedProp:_0x12c9e3}of this['_recalculateBuffer'])_0xfcb7('0x6')===_0x12c9e3?this[_0xfcb7('0x3a')](_0x5017ea):this[_0xfcb7('0x46')](_0x5017ea);this[_0xfcb7('0x22')]=[];},0xa),this[_0xfcb7('0x22')][_0xfcb7('0x3f')]({'sidebarItemView':_0x496c3d,'changedProp':_0x1c59c8});}[_0xfcb7('0x40')](_0x3513fc){return this['_annotationToSidebarItemView'][_0xfcb7('0xa')](_0x3513fc);}[_0xfcb7('0x48')](){this[_0xfcb7('0x2e')]['destroy']();}[_0xfcb7('0x19')](_0x2109ed){const _0x226415=this['getSidebarItemView'](_0x2109ed);this[_0xfcb7('0x2f')](_0x226415),this['stopListening'](_0x2109ed['view']),_0x226415['destroy'](),this[_0xfcb7('0x16')][_0xfcb7('0x1a')](_0x2109ed),this[_0xfcb7('0x39')]['delete'](_0x226415);}[_0xfcb7('0xc')](){const _0x1f6cea=new _0x224b0d(this[_0xfcb7('0x24')][_0xfcb7('0x32')]);return _0x1f6cea[_0xfcb7('0x23')](),this['on']('change:_lastItem',(_0x1a3105,_0x4b81a4,_0x387fd8,_0x57a4b4)=>{_0x57a4b4&&_0x1f6cea[_0xfcb7('0x3')](_0xfcb7('0x8')),_0x387fd8?_0x1f6cea['bind'](_0xfcb7('0x8'))['to'](_0x387fd8,_0xfcb7('0x36')):_0x1f6cea[_0xfcb7('0x8')]=null;}),_0x1f6cea;}[_0xfcb7('0x37')](){this['_lastItem']=this['getSidebarItemView'](this['_annotations'][_0xfcb7('0xe')]);}[_0xfcb7('0x7')](_0x5cf43c){const _0x333e89=this['_sidebarItemViewToAnnotation'][_0xfcb7('0xa')](_0x5cf43c),_0x18ecd1=this[_0xfcb7('0x3b')]['get'](this[_0xfcb7('0x3b')][_0xfcb7('0x31')](_0x333e89)-0x1);return _0x18ecd1&&this[_0xfcb7('0x40')](_0x18ecd1);}[_0xfcb7('0x25')](_0x5f4f1b){const _0x157f8d=this['_sidebarItemViewToAnnotation']['get'](_0x5f4f1b),_0x33b07a=this[_0xfcb7('0x3b')]['get'](this[_0xfcb7('0x3b')][_0xfcb7('0x31')](_0x157f8d)+0x1);return _0x33b07a&&this[_0xfcb7('0x40')](_0x33b07a);}[_0xfcb7('0x18')](_0x4d5897,_0x2c3bf6){_0x4d5897[_0xfcb7('0x12')]();const _0x2553bf=F(_0x2c3bf6[_0xfcb7('0x36')]+this[_0xfcb7('0x17')],_0x4d5897[_0xfcb7('0x6')]);return!!_0x2553bf&&(this['_setItemTop'](_0x2c3bf6,_0x2c3bf6[_0xfcb7('0x6')]-_0x2553bf),!0x0);}['_alignAfterItem'](_0x59f79e,_0x432067){_0x59f79e[_0xfcb7('0x12')]();const _0x40cced=F(_0x59f79e[_0xfcb7('0x36')]+this[_0xfcb7('0x17')],_0x432067[_0xfcb7('0x6')]);return!!_0x40cced&&(this[_0xfcb7('0x2c')](_0x432067,_0x432067['top']+_0x40cced,!0x1),!0x0);}[_0xfcb7('0x29')](_0x265f2c){const _0x41c5dd=this[_0xfcb7('0x39')]['get'](_0x265f2c);if(!_0x41c5dd||!_0x41c5dd[_0xfcb7('0x47')])return;const _0x1e7711=this[_0xfcb7('0x1f')](_0x41c5dd,_0x41c5dd[_0xfcb7('0x30')]);this[_0xfcb7('0x2c')](_0x265f2c,_0x1e7711);}[_0xfcb7('0x1f')](_0x5c0b13,_0x232204){if(null===_0x232204)return 0x0;if(_0x5c0b13[_0xfcb7('0x47')]instanceof _0x314f8d)return _0x232204[_0xfcb7('0x6')];{const _0x450590=new _0x314f8d(this[_0xfcb7('0x2e')]['element'])[_0xfcb7('0x6')];return _0x232204[_0xfcb7('0x6')]-_0x450590;}}[_0xfcb7('0x2c')](_0x41890a,_0x5c81f1,_0x34181d=this['context'][_0xfcb7('0x3e')]['get'](_0xfcb7('0x21'))){_0x34181d&&(_0x5c81f1=Math[_0xfcb7('0x1c')](_0x5c81f1,this[_0xfcb7('0x45')](_0x41890a))),_0x41890a[_0xfcb7('0x6')]=_0x5c81f1;}[_0xfcb7('0x45')](_0xfdd6da){let _0xc03256=this['_getItemBefore'](_0xfdd6da),_0x1b6ac=0x0;for(;_0xc03256;)_0xc03256[_0xfcb7('0x12')](),_0x1b6ac+=this[_0xfcb7('0x17')]+_0xc03256['height'],_0xc03256=this[_0xfcb7('0x7')](_0xc03256);return _0x1b6ac;}}function F(_0x3b9a04,_0x1040e4){return Math['max'](_0x3b9a04-_0x1040e4,0x0);}function p(_0x2559e0){return null!==_0x2559e0&&_0xfcb7('0x26')==typeof _0x2559e0&&0x1===_0x2559e0[_0xfcb7('0x38')];}
23
+ const _0xbd5d=['delete','_getTargetTop','stopListening','locale','isActive','_alignBeforeItem','_alignForBottomChange','last','content','getIndex','_alignToTargetRect','nodeType','clear','setContainer','unbind','_annotationToSidebarItemView','Sidebar','config','get','length','define','sidebar-setcontainer-invalid-element','remove','_setItemTop','change:bottom','change:targetRect','_recalculate','object','top','listenTo','_alignAfterItem','render','_spaceBetweenItems','_alignForTopChange','view','minHeight','pluginName','destroy','_createSidebarView','_getItemAfter','class','bottom','refresh','sidebar.preventScrollOutOfView','max','_targetTop','_annotations','_recalculateBuffer','_updateLastItem','_destroySidebarItemView','_detachFromContainer','context','getSidebarItemView','add','_getItemBefore','updateHeight','isAnimationDisabled','_sidebarItemViewToAnnotation','_lastItem','list','target','set','push','change:_lastItem','element','_attachToContainer','container','targetRect','_activeAnnotation'];(function(_0x4a9325,_0xbd5d8){const _0x14d88b=function(_0x54d536){while(--_0x54d536){_0x4a9325['push'](_0x4a9325['shift']());}};_0x14d88b(++_0xbd5d8);}(_0xbd5d,0x19d));const _0x14d8=function(_0x4a9325,_0xbd5d8){_0x4a9325=_0x4a9325-0x0;let _0x14d88b=_0xbd5d[_0x4a9325];return _0x14d88b;};import{ContextPlugin as _0xef7107}from'ckeditor5/src/core';import{Rect as _0x30d9b3,CKEditorError as _0xca2795}from'ckeditor5/src/utils';import _0x4a422e from'./view/sidebarview';import _0x1db480 from'./view/sidebaritemview';export default class z extends _0xef7107{static get[_0x14d8('0x25')](){return _0x14d8('0x11');}constructor(_0xe5be3d){super(_0xe5be3d),this[_0x14d8('0x3e')]('_lastItem',void 0x0),this['view']=this[_0x14d8('0x27')](),this[_0x14d8('0x3e')]('container',null),this[_0x14d8('0x21')]=0x19,this[_0x14d8('0x3a')]=new Map(),this[_0x14d8('0x10')]=new Map(),this['context'][_0x14d8('0x12')][_0x14d8('0x15')](_0x14d8('0x2c'),!0x1),this[_0x14d8('0x2f')]=null,this['_activeAnnotation']=null,this[_0x14d8('0x30')]=[];}['init'](){const _0x2fd00d=this[_0x14d8('0x34')][_0x14d8('0x12')][_0x14d8('0x13')]('sidebar.container');_0x2fd00d&&this[_0x14d8('0xe')](_0x2fd00d);}[_0x14d8('0xe')](_0x4d36dd){if(!y(_0x4d36dd))throw new _0xca2795(_0x14d8('0x16'));this[_0x14d8('0x43')]=_0x4d36dd;}[_0x14d8('0x42')]({viewClass:_0x447006='',spaceBetweenItems:_0x2ba89e=0x19}={}){if(!y(this[_0x14d8('0x43')]))throw new _0xca2795('sidebar-attachtocontainer-missing-container',this);this[_0x14d8('0x43')]['appendChild'](this[_0x14d8('0x23')][_0x14d8('0x41')]),this[_0x14d8('0x23')]['class']=_0x447006,this[_0x14d8('0x21')]=_0x2ba89e;}['rearrange']({removedAnnotation:_0x412676,previousAnnotation:_0x50e618,nextAnnotation:_0x1638b6}){const _0x34a101=this[_0x14d8('0x35')](_0x412676);this[_0x14d8('0x23')]['list'][_0x14d8('0x17')](_0x34a101),this[_0x14d8('0x32')](_0x412676),_0x50e618&&this[_0x14d8('0xb')](this[_0x14d8('0x35')](_0x50e618)),_0x1638b6&&this[_0x14d8('0xb')](this[_0x14d8('0x35')](_0x1638b6)),this[_0x14d8('0x31')]();}[_0x14d8('0x2b')]({blurredAnnotation:_0x570d68,activatedAnnotation:_0x43a822,disableAnimationOnActivatedAnnotation:_0x59a75c}){if(this[_0x14d8('0x0')]=_0x43a822,_0x570d68){_0x570d68['isActive']=!0x1;const _0x190622=this['getSidebarItemView'](_0x570d68);_0x190622&&_0x59a75c&&(_0x190622['isAnimationDisabled']=!0x1);}if(_0x43a822){const _0x576e3c=this[_0x14d8('0x35')](_0x43a822);_0x576e3c&&(_0x43a822[_0x14d8('0x5')]=!0x0,_0x59a75c&&(_0x576e3c[_0x14d8('0x39')]=!0x0,_0x576e3c[_0x14d8('0x1d')]+=0x1),this['_alignToTargetRect'](_0x576e3c));}}[_0x14d8('0x33')](_0x3f9a16){if(this['stopListening'](),this['view'][_0x14d8('0x41')][_0x14d8('0x17')](),_0x3f9a16)for(const _0x15cc7a of _0x3f9a16)this[_0x14d8('0x32')](_0x15cc7a);this['view']['list'][_0x14d8('0xd')](),this[_0x14d8('0x23')][_0x14d8('0x29')]='',this[_0x14d8('0x3b')]=null;}['addAnnotation'](_0x56a015,_0xf4e334){_0xf4e334||(_0xf4e334=_0x56a015[_0x14d8('0x23')]);const _0x459661=new _0x1db480(this[_0x14d8('0x34')]['locale']);this['_sidebarItemViewToAnnotation']['set'](_0x459661,_0x56a015),this[_0x14d8('0x10')][_0x14d8('0x3e')](_0x56a015,_0x459661),_0x459661['content']['add'](_0xf4e334),this[_0x14d8('0x1e')](_0x56a015['view'],_0x14d8('0x1a'),(_0x8364bd,_0x4f6e0d,_0x10eb5b)=>{const _0x45b755=this[_0x14d8('0x2')](_0x56a015,_0x10eb5b);_0x459661[_0x14d8('0x2e')]!=_0x45b755&&(_0x459661[_0x14d8('0x2e')]=_0x45b755,this[_0x14d8('0x18')](_0x459661,_0x45b755));}),this[_0x14d8('0x1e')](_0x459661,'change:top',()=>{this[_0x14d8('0x1b')](_0x459661,_0x14d8('0x1d'));}),this[_0x14d8('0x1e')](_0x459661,_0x14d8('0x19'),()=>{this[_0x14d8('0x1b')](_0x459661,_0x14d8('0x2a'));}),this[_0x14d8('0xb')](_0x459661);const _0x447642=this[_0x14d8('0x37')](_0x459661);if(_0x447642)this[_0x14d8('0x1f')](_0x447642,_0x459661)||this['_alignToTargetRect'](_0x459661);else this[_0x14d8('0xb')](_0x459661);return this[_0x14d8('0x31')](),this[_0x14d8('0x23')][_0x14d8('0x3c')][_0x14d8('0x36')](_0x459661),_0x459661;}[_0x14d8('0x22')](_0x1877d5){if(!_0x1877d5[_0x14d8('0x9')][_0x14d8('0x14')])return;const _0x574c75=this[_0x14d8('0x37')](_0x1877d5);if(!_0x574c75)return;const _0xcb8a97=this[_0x14d8('0x3a')][_0x14d8('0x13')](_0x574c75),_0x12e153=this['_activeAnnotation'];_0x12e153&&_0x12e153===_0xcb8a97?this[_0x14d8('0x1f')](_0x574c75,_0x1877d5):this[_0x14d8('0x6')](_0x1877d5,_0x574c75);}[_0x14d8('0x7')](_0x2c500b){if(!_0x2c500b['content'][_0x14d8('0x14')])return;const _0x1f5de9=this[_0x14d8('0x28')](_0x2c500b);if(!_0x1f5de9)return;const _0x3a5455=this['_sidebarItemViewToAnnotation'][_0x14d8('0x13')](_0x1f5de9),_0x14724d=this[_0x14d8('0x34')][_0x14d8('0x12')][_0x14d8('0x13')](_0x14d8('0x2c')),_0x439104=this[_0x14d8('0x0')];_0x439104&&_0x439104===_0x3a5455&&_0x14724d?(this['_alignBeforeItem'](_0x1f5de9,_0x2c500b),this[_0x14d8('0x1f')](_0x2c500b,_0x1f5de9)):_0x439104&&_0x439104===_0x3a5455?this[_0x14d8('0x6')](_0x1f5de9,_0x2c500b):this[_0x14d8('0x1f')](_0x2c500b,_0x1f5de9);}[_0x14d8('0x1b')](_0x5c4fdb,_0x2a5b03){0x0===this['_recalculateBuffer']['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x5b8a14,changedProp:_0x1dfcf1}of this[_0x14d8('0x30')])_0x14d8('0x1d')===_0x1dfcf1?this[_0x14d8('0x22')](_0x5b8a14):this[_0x14d8('0x7')](_0x5b8a14);this[_0x14d8('0x30')]=[];},0xa),this['_recalculateBuffer'][_0x14d8('0x3f')]({'sidebarItemView':_0x5c4fdb,'changedProp':_0x2a5b03});}['getSidebarItemView'](_0x580f38){return this[_0x14d8('0x10')][_0x14d8('0x13')](_0x580f38);}[_0x14d8('0x26')](){this['view'][_0x14d8('0x26')]();}[_0x14d8('0x32')](_0x385b81){const _0x4048e6=this[_0x14d8('0x35')](_0x385b81);this[_0x14d8('0x3')](_0x4048e6),this[_0x14d8('0x3')](_0x385b81[_0x14d8('0x23')]),_0x4048e6['destroy'](),this['_annotationToSidebarItemView'][_0x14d8('0x1')](_0x385b81),this[_0x14d8('0x3a')][_0x14d8('0x1')](_0x4048e6);}[_0x14d8('0x27')](){const _0x201b3c=new _0x4a422e(this[_0x14d8('0x34')][_0x14d8('0x4')]);return _0x201b3c[_0x14d8('0x20')](),this['on'](_0x14d8('0x40'),(_0x34b593,_0x1a6445,_0x98b80e,_0x29a2e2)=>{_0x29a2e2&&_0x201b3c[_0x14d8('0xf')](_0x14d8('0x24')),_0x98b80e?_0x201b3c['bind']('minHeight')['to'](_0x98b80e,_0x14d8('0x2a')):_0x201b3c[_0x14d8('0x24')]=null;}),_0x201b3c;}[_0x14d8('0x31')](){var _0x516dec;this['_lastItem']=(null===(_0x516dec=this['_annotations'])||void 0x0===_0x516dec?void 0x0:_0x516dec['last'])?this['getSidebarItemView'](this[_0x14d8('0x2f')][_0x14d8('0x8')]):null;}[_0x14d8('0x37')](_0x806b7c){var _0x19db0d;const _0x197a15=this['_sidebarItemViewToAnnotation'][_0x14d8('0x13')](_0x806b7c),_0x582f31=_0x197a15&&(null===(_0x19db0d=this[_0x14d8('0x2f')])||void 0x0===_0x19db0d?void 0x0:_0x19db0d[_0x14d8('0x13')](this[_0x14d8('0x2f')]['getIndex'](_0x197a15)-0x1));return _0x582f31&&this[_0x14d8('0x35')](_0x582f31)||null;}[_0x14d8('0x28')](_0x30d1bf){var _0x13b31e;const _0xca86d1=this[_0x14d8('0x3a')][_0x14d8('0x13')](_0x30d1bf),_0x5799d1=_0xca86d1&&(null===(_0x13b31e=this[_0x14d8('0x2f')])||void 0x0===_0x13b31e?void 0x0:_0x13b31e['get'](this[_0x14d8('0x2f')][_0x14d8('0xa')](_0xca86d1)+0x1));return _0x5799d1&&this[_0x14d8('0x35')](_0x5799d1)||null;}[_0x14d8('0x6')](_0x3ae9fc,_0x545cbf){_0x3ae9fc[_0x14d8('0x38')]();const _0x5c83b3=H(_0x545cbf[_0x14d8('0x2a')]+this[_0x14d8('0x21')],_0x3ae9fc[_0x14d8('0x1d')]);return!!_0x5c83b3&&(this[_0x14d8('0x18')](_0x545cbf,_0x545cbf[_0x14d8('0x1d')]-_0x5c83b3),!0x0);}[_0x14d8('0x1f')](_0x2814bf,_0x1320be){_0x2814bf[_0x14d8('0x38')]();const _0x2a4515=H(_0x2814bf[_0x14d8('0x2a')]+this[_0x14d8('0x21')],_0x1320be[_0x14d8('0x1d')]);return!!_0x2a4515&&(this[_0x14d8('0x18')](_0x1320be,_0x1320be['top']+_0x2a4515,!0x1),!0x0);}[_0x14d8('0xb')](_0x409e24){const _0xe35952=this[_0x14d8('0x3a')][_0x14d8('0x13')](_0x409e24);if(!_0xe35952||!_0xe35952[_0x14d8('0x3d')]||!_0xe35952[_0x14d8('0x44')])return;const _0x4cb9f5=this[_0x14d8('0x2')](_0xe35952,_0xe35952[_0x14d8('0x44')]);this[_0x14d8('0x18')](_0x409e24,_0x4cb9f5);}[_0x14d8('0x2')](_0x15c49a,_0x3d7278){if(null===_0x3d7278)return 0x0;if(_0x15c49a['target']instanceof _0x30d9b3)return _0x3d7278[_0x14d8('0x1d')];{const _0xa8f39=new _0x30d9b3(this[_0x14d8('0x23')][_0x14d8('0x41')])['top'];return _0x3d7278[_0x14d8('0x1d')]-_0xa8f39;}}[_0x14d8('0x18')](_0x2e695d,_0x18f6b7,_0x198954=this[_0x14d8('0x34')][_0x14d8('0x12')]['get'](_0x14d8('0x2c'))){_0x198954&&(_0x18f6b7=Math[_0x14d8('0x2d')](_0x18f6b7,this['_getMaxAvailableTop'](_0x2e695d))),_0x2e695d[_0x14d8('0x1d')]=_0x18f6b7;}['_getMaxAvailableTop'](_0x15bb19){let _0x5145c9=this[_0x14d8('0x37')](_0x15bb19),_0x41aff7=0x0;for(;_0x5145c9;)_0x5145c9[_0x14d8('0x38')](),_0x41aff7+=this['_spaceBetweenItems']+_0x5145c9['height'],_0x5145c9=this[_0x14d8('0x37')](_0x5145c9);return _0x41aff7;}}function H(_0x658b14,_0x57338f){return Math['max'](_0x658b14-_0x57338f,0x0);}function y(_0x604390){return null!==_0x604390&&_0x14d8('0x1c')==typeof _0x604390&&0x1===_0x604390[_0x14d8('0xc')];}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @module comments/annotations/view/annotationcounterbuttonview
3
+ * @publicApi
4
+ */
5
+ import { ButtonView, View } from 'ckeditor5/src/ui';
6
+ import type { Locale } from 'ckeditor5/src/utils';
7
+ /**
8
+ * A view used in the sidebar by {@link module:comments/annotations/narrowsidebar~NarrowSidebar}.
9
+ */
10
+ export default class AnnotationCounterButtonView extends ButtonView {
11
+ /**
12
+ * @observable
13
+ */
14
+ isDirty: boolean;
15
+ /**
16
+ * @observable
17
+ */
18
+ number: number;
19
+ /**
20
+ * @observable
21
+ */
22
+ annotationType: string;
23
+ counterView: View;
24
+ constructor(locale: Locale);
25
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x1cb8=['annotationType','number','span','bind','isDirty','_badge','bindTemplate','children','set','...','ck-annotation-counter__badge--','counterView','ck-annotation-counter__badge'];(function(_0x1de759,_0x1cb811){const _0x4302dc=function(_0x405e33){while(--_0x405e33){_0x1de759['push'](_0x1de759['shift']());}};_0x4302dc(++_0x1cb811);}(_0x1cb8,0xe1));const _0x4302=function(_0x1de759,_0x1cb811){_0x1de759=_0x1de759-0x0;let _0x4302dc=_0x1cb8[_0x1de759];return _0x4302dc;};import{ButtonView as _0x484eef,View as _0x19cd86}from'ckeditor5/src/ui';import _0x18981a from'../../../theme/icons/add-comment.svg';export default class z extends _0x484eef{constructor(_0x4a354e){super(_0x4a354e);const _0x4de59d=this[_0x4302('0x2')];this[_0x4302('0x4')](_0x4302('0x0'),!0x1),this[_0x4302('0x4')]('number',0x0),this[_0x4302('0xc')](_0x4302('0x1'))['to'](this,_0x4302('0x0'),this,_0x4302('0xa'),(_0x49abe4,_0x45368f)=>_0x49abe4?_0x4302('0x5'):_0x45368f),this[_0x4302('0x4')](_0x4302('0x9'),''),this['icon']=_0x18981a,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this[_0x4302('0x7')]=new _0x19cd86(),this[_0x4302('0x7')]['setTemplate']({'tag':_0x4302('0xb'),'attributes':{'class':[_0x4302('0x8'),_0x4de59d['to'](_0x4302('0x9'),_0x518363=>_0x4302('0x6')+_0x518363),_0x4de59d['if'](_0x4302('0x0'),'ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x4de59d['to'](_0x4302('0x1'))}]}),this[_0x4302('0x3')]['add'](this[_0x4302('0x7')]);}}
23
+ const _0x5f4c=['toString','counterView','span','icon','isDirty','_badge','ck-annotation-counter__badge','set','ck-annotation-counter__badge--','bindTemplate','add','ck-annotation-counter__badge--edit-mode','setTemplate','annotationType','extendTemplate'];(function(_0x23877a,_0x5f4c58){const _0x5641c8=function(_0x56b465){while(--_0x56b465){_0x23877a['push'](_0x23877a['shift']());}};_0x5641c8(++_0x5f4c58);}(_0x5f4c,0xf9));const _0x5641=function(_0x23877a,_0x5f4c58){_0x23877a=_0x23877a-0x0;let _0x5641c8=_0x5f4c[_0x23877a];return _0x5641c8;};import{ButtonView as _0x11b5a2,View as _0x3668e7}from'ckeditor5/src/ui';import _0x110ac7 from'../../../theme/icons/add-comment.svg';export default class D extends _0x11b5a2{constructor(_0x13e2d5){super(_0x13e2d5);const _0x5a024f=this[_0x5641('0x0')];this[_0x5641('0xd')](_0x5641('0xa'),!0x1),this['set']('number',0x0),this['bind'](_0x5641('0xb'))['to'](this,'isDirty',this,'number',(_0x7c034,_0x48f9e8)=>_0x7c034?'...':_0x48f9e8[_0x5641('0x6')]()),this[_0x5641('0xd')](_0x5641('0x4'),''),this[_0x5641('0x9')]=_0x110ac7,this[_0x5641('0x5')]({'attributes':{'class':['ck-annotation-counter']}}),this[_0x5641('0x7')]=new _0x3668e7(),this[_0x5641('0x7')][_0x5641('0x3')]({'tag':_0x5641('0x8'),'attributes':{'class':[_0x5641('0xc'),_0x5a024f['to'](_0x5641('0x4'),_0x412d3c=>_0x5641('0xe')+_0x412d3c),_0x5a024f['if'](_0x5641('0xa'),_0x5641('0x2'))]},'children':[{'text':_0x5a024f['to'](_0x5641('0xb'))}]}),this['children'][_0x5641('0x1')](this['counterView']);}}