@ckeditor/ckeditor5-comments 36.0.0 → 37.0.0-rc.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 +20 -4
  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 _0x2236=['hasActive','left','has','_forceRefresh','_manuallyClosed','pluginName','editableElement','Esc','attach','get','width','hasView','getBoundingClientRect','editor','afterInit','focus','switchTo','_addAnnotationToBalloon','top','requires','inlineannotations-detach-not-attached','isFocused','focusTracker','updatePosition','context','change:height','_closeAnnotation','every','plugins','inlineannotations-not-allowed-with-context','_balloon','init','_getBalloonTargetForAnnotation','update','refresh','includes','_removeAnnotationFromBalloon','selection','getFirstRange','view','change:visibleView','_addedAnnotations','find','getClientRects','setActiveAnnotation','register','map','mousedown','inline','annotations','isAttached','editing','length','clear','domConverter','fromRect','showStack','_selectedAnnotations','viewRangeToDom','activeAnnotation','bottom','_setSelectedAnnotations','push','targetRect','remove','getByView','isActive','from','document','getOrderedSelectedAnnotations','add','detach','destroy','visibleView','right','inlineannotations-attach-already-attached','change:isFocused','target','keystrokes','listenTo'];(function(_0x488c71,_0x223642){const _0x49a428=function(_0x20f5f3){while(--_0x20f5f3){_0x488c71['push'](_0x488c71['shift']());}};_0x49a428(++_0x223642);}(_0x2236,0x195));const _0x49a4=function(_0x488c71,_0x223642){_0x488c71=_0x488c71-0x0;let _0x49a428=_0x2236[_0x488c71];return _0x49a428;};import{Plugin as _0x570b26}from'ckeditor5/src/core';import _0x4c0da4 from'./annotationsuis';import _0x4e6973 from'./editorannotations';import{ContextualBalloon as _0x3375ef}from'ckeditor5/src/ui';import{MouseObserver as _0x3aede7}from'ckeditor5/src/engine';import{CKEditorError as _0x54a435,Rect as _0x16318c}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class a extends _0x570b26{static get[_0x49a4('0xe')](){return[_0x4e6973,_0x3375ef,_0x4c0da4];}static get[_0x49a4('0x0')](){return'InlineAnnotations';}constructor(_0x396865){super(_0x396865),_0x396865[_0x49a4('0x2e')][_0x49a4('0x22')]['addObserver'](_0x3aede7),this['isAttached']=!0x1,this['set'](_0x49a4('0x36'),null),this['annotations']=null,this['_manuallyClosed']=new Set(),this[_0x49a4('0x19')]=_0x396865['plugins'][_0x49a4('0x4')](_0x3375ef),this[_0x49a4('0x24')]=new Set(),this['_selectedAnnotations']=[],this[_0x49a4('0x4e')]=!0x1;}[_0x49a4('0x1a')](){const _0x49fdad=this[_0x49a4('0x8')][_0x49a4('0x17')][_0x49a4('0x4')](_0x4c0da4);_0x49fdad[_0x49a4('0x13')]===this[_0x49a4('0x8')]&&(_0x49fdad[_0x49a4('0x28')](_0x49a4('0x2b'),this),this[_0x49a4('0x8')][_0x49a4('0x49')]['set']('Esc',(_0x52a247,_0x216b1d)=>{const _0x596f3=this[_0x49a4('0x19')];if(this[_0x49a4('0x2d')]&&_0x596f3[_0x49a4('0x44')]){const _0x57fe3a=this[_0x49a4('0x2c')][_0x49a4('0x3c')](_0x596f3['visibleView']);this[_0x49a4('0x15')](_0x57fe3a),_0x216b1d();}}));}[_0x49a4('0x9')](){const _0x5a1312=this[_0x49a4('0x8')][_0x49a4('0x17')]['get'](_0x4c0da4);_0x5a1312[_0x49a4('0x13')]===this['editor']&&(_0x5a1312[_0x49a4('0x4b')]()||_0x5a1312[_0x49a4('0xb')]('inline'));}[_0x49a4('0x27')](_0x477990){_0x477990!==this[_0x49a4('0x36')]&&(this[_0x49a4('0x36')]&&(this['activeAnnotation'][_0x49a4('0x3d')]=!0x1),_0x477990&&this[_0x49a4('0x8')]['ui'][_0x49a4('0x11')][_0x49a4('0x10')]&&(this[_0x49a4('0xc')](_0x477990,!0x0),_0x477990['isActive']=!0x0),_0x477990||this['_setSelectedAnnotations']([]),this[_0x49a4('0x36')]=_0x477990);}[_0x49a4('0x3')](_0x3f770b){this['annotations']=_0x3f770b;const _0x236bd7=this[_0x49a4('0x8')][_0x49a4('0x17')][_0x49a4('0x4')](_0x4c0da4),_0x544378=this['_balloon'];if(this[_0x49a4('0x2d')])throw new _0x54a435(_0x49a4('0x46'),this);if(_0x236bd7['context']!==this[_0x49a4('0x8')])throw new _0x54a435(_0x49a4('0x18'),this);const _0x5871c9=this[_0x49a4('0x8')][_0x49a4('0x17')][_0x49a4('0x4')]('EditorAnnotations');this[_0x49a4('0x4a')](_0x5871c9,_0x49a4('0x1d'),function(){const _0x4837e8=_0x5871c9[_0x49a4('0x40')]({'activeAnnotation':this['activeAnnotation'],'annotations':this[_0x49a4('0x2c')]});if(!this['_forceRefresh']&&(_0x3e9396=_0x4837e8,_0x425a4f=this[_0x49a4('0x34')],_0x3e9396[_0x49a4('0x2f')]===_0x425a4f[_0x49a4('0x2f')]&&_0x3e9396[_0x49a4('0x16')](_0x2d87be=>_0x425a4f[_0x49a4('0x1e')](_0x2d87be))))return;var _0x3e9396,_0x425a4f;this[_0x49a4('0x4e')]=!0x1,this[_0x49a4('0x38')](_0x4837e8),this[_0x49a4('0x27')](_0x4837e8[0x0]||null);}['bind'](this)),this[_0x49a4('0x4a')](_0x5871c9,'blur',(_0x2ae2cd,{isAnnotationTracked:_0x400f5d})=>{this[_0x49a4('0x36')]&&_0x400f5d(this['activeAnnotation'])&&(this[_0x49a4('0x38')]([]),this[_0x49a4('0x27')](null));}),this[_0x49a4('0x4a')](this[_0x49a4('0x8')]['ui']['focusTracker'],_0x49a4('0x47'),(_0x21f021,_0xd623c2,_0x5a3f7a)=>{_0x5a3f7a||this['setActiveAnnotation'](null);}),this[_0x49a4('0x4a')](_0x3f770b,_0x49a4('0x3b'),(_0x3a609c,_0x68813e)=>{this[_0x49a4('0x1f')](_0x68813e),_0x68813e===this[_0x49a4('0x36')]&&this[_0x49a4('0x27')](null);}),this['listenTo'](_0x544378,_0x49a4('0x23'),(_0x8b9687,_0x51e5d5,_0x30d708,_0x5a2f7f)=>{if(_0x5a2f7f&&this['stopListening'](_0x5a2f7f),!_0x30d708||!_0x3f770b['getByView'](_0x30d708))return;const _0x5c8f24=_0x3f770b[_0x49a4('0x3c')](_0x30d708);this[_0x49a4('0x4a')](_0x30d708,_0x49a4('0x14'),()=>{_0x544378[_0x49a4('0x12')]();}),this[_0x49a4('0x4a')](_0x30d708,_0x49a4('0x2'),()=>{this[_0x49a4('0x15')](_0x5c8f24),this['editor'][_0x49a4('0x2e')][_0x49a4('0x22')][_0x49a4('0xa')]();}),this['activeAnnotation']!==_0x5c8f24&&this[_0x49a4('0x27')](_0x5c8f24);}),this['listenTo'](this[_0x49a4('0x8')]['ui'],_0x49a4('0x1c'),()=>{_0x544378['visibleView']&&(_0x3f770b[_0x49a4('0x3c')](_0x544378[_0x49a4('0x44')])&&_0x544378[_0x49a4('0x12')]());}),this[_0x49a4('0x4a')](this[_0x49a4('0x8')][_0x49a4('0x2e')]['view'][_0x49a4('0x3f')],_0x49a4('0x2a'),()=>{this[_0x49a4('0x4e')]=!0x0,this[_0x49a4('0x4f')][_0x49a4('0x30')]();}),this['editor'][_0x49a4('0x2e')][_0x49a4('0x22')]['document'][_0x49a4('0x20')][_0x49a4('0x1')]&&this[_0x49a4('0x8')][_0x49a4('0x2e')][_0x49a4('0x22')][_0x49a4('0xa')](),this[_0x49a4('0x2d')]=!0x0;}[_0x49a4('0x42')](){if(!this[_0x49a4('0x2d')])throw new _0x54a435(_0x49a4('0xf'),this);this[_0x49a4('0x27')](null);for(const _0x48813f of this['_addedAnnotations'])this[_0x49a4('0x1f')](_0x48813f);this['stopListening'](),this['isAttached']=!0x1,this['annotations']=null;}[_0x49a4('0x43')](){this['isAttached']&&this[_0x49a4('0x42')]();}[_0x49a4('0x38')](_0x90d7a7){for(const _0x526d30 of this[_0x49a4('0x34')])_0x90d7a7[_0x49a4('0x1e')](_0x526d30)||this['_manuallyClosed']['delete'](_0x526d30);for(const _0x4ef536 of this[_0x49a4('0x2c')])_0x90d7a7[_0x49a4('0x1e')](_0x4ef536)||this[_0x49a4('0x1f')](_0x4ef536);if(this['editor']['ui']['focusTracker'][_0x49a4('0x10')])for(const _0x34664f of _0x90d7a7)this[_0x49a4('0xc')](_0x34664f);this[_0x49a4('0x34')]=_0x90d7a7;}[_0x49a4('0xc')](_0x5d4f78,_0x3668be){this[_0x49a4('0x4f')][_0x49a4('0x4d')](_0x5d4f78)||(this['_addedAnnotations'][_0x49a4('0x4d')](_0x5d4f78)||this[_0x49a4('0x19')][_0x49a4('0x6')](_0x5d4f78[_0x49a4('0x22')])||(this[_0x49a4('0x24')]['add'](_0x5d4f78),this[_0x49a4('0x19')]['add']({'stackId':_0x5d4f78[_0x49a4('0x22')]['id'],'view':_0x5d4f78['view'],'position':{'target':()=>this[_0x49a4('0x1b')](_0x5d4f78)}})),_0x3668be&&this[_0x49a4('0x19')][_0x49a4('0x33')](_0x5d4f78[_0x49a4('0x22')]['id']));}['_getBalloonTargetForAnnotation'](_0x34b6b9){const _0xac1413=_0x34b6b9[_0x49a4('0x48')],_0xfc5c31=this['editor'][_0x49a4('0x2e')][_0x49a4('0x22')],_0x31781c=_0xfc5c31['document'][_0x49a4('0x20')][_0x49a4('0x21')](),_0x2fe2c8=_0xfc5c31[_0x49a4('0x31')][_0x49a4('0x35')](_0x31781c);if(_0x2fe2c8['collapse'](!0x0),_0xac1413){if(_0xac1413 instanceof _0x16318c)return _0xac1413;let _0x577d1b=[];for(const _0x3af685 of _0xac1413)_0x577d1b['push'](...(_0x2298e4=_0x3af685[_0x49a4('0x26')](),Array[_0x49a4('0x3e')](_0x2298e4)[_0x49a4('0x29')](DOMRect[_0x49a4('0x32')])));_0x577d1b=function(_0x2a2694){const _0x6a7886=[];let _0x361402=_0x2a2694[0x0];for(let _0x4b68fd=0x1;_0x4b68fd<_0x2a2694[_0x49a4('0x2f')];_0x4b68fd++)E(_0x361402,_0x2a2694[_0x4b68fd])?_0x361402['width']+=_0x2a2694[_0x4b68fd][_0x49a4('0x5')]:(_0x6a7886[_0x49a4('0x39')](_0x361402),_0x361402=_0x2a2694[_0x4b68fd]);return _0x6a7886['push'](_0x361402),_0x6a7886;}(_0x577d1b);const _0x180488=_0x2fe2c8[_0x49a4('0x7')]();return _0x577d1b[_0x49a4('0x25')](_0x46894b=>_0x46894b[_0x49a4('0xd')]<=_0x180488[_0x49a4('0xd')]&&_0x46894b[_0x49a4('0x37')]>=_0x180488[_0x49a4('0x37')]&&_0x46894b['left']<=_0x180488[_0x49a4('0x4c')]&&_0x46894b[_0x49a4('0x45')]>=_0x180488['right'])||_0x577d1b[0x0];}var _0x2298e4;return _0x34b6b9[_0x49a4('0x3a')]||_0x2fe2c8;}['_removeAnnotationFromBalloon'](_0x480532){this[_0x49a4('0x24')][_0x49a4('0x4d')](_0x480532)&&this[_0x49a4('0x19')][_0x49a4('0x6')](_0x480532[_0x49a4('0x22')])&&(this[_0x49a4('0x24')]['delete'](_0x480532),this[_0x49a4('0x19')][_0x49a4('0x3b')](_0x480532['view']));}[_0x49a4('0x15')](_0x5d3286){this[_0x49a4('0x4f')][_0x49a4('0x41')](_0x5d3286),this[_0x49a4('0x1f')](_0x5d3286);}}function E(_0x57755b,_0x152910){return _0x57755b[_0x49a4('0xd')]===_0x152910['top']&&_0x57755b[_0x49a4('0x37')]===_0x152910[_0x49a4('0x37')]&&_0x57755b[_0x49a4('0x45')]===_0x152910[_0x49a4('0x4c')];}
23
+ const _0x2d96=['isFocused','includes','bottom','plugins','from','detach','_forceRefresh','_setSelectedAnnotations','remove','clear','pluginName','fromRect','top','editing','stopListening','length','inlineannotations-not-allowed-with-context','_manuallyClosed','hasActive','set','add','afterInit','getByView','document','Esc','every','push','_closeAnnotation','getOrderedSelectedAnnotations','view','keystrokes','target','focus','get','change:visibleView','showStack','switchTo','_balloon','right','_addedAnnotations','destroy','isActive','setActiveAnnotation','isAttached','_removeAnnotationFromBalloon','editor','editableElement','addObserver','change:isFocused','change:height','activeAnnotation','getBoundingClientRect','hasView','attach','blur','annotations','focusTracker','delete','map','context','left','listenTo','targetRect','updatePosition','update','_addAnnotationToBalloon','find','collapse','_selectedAnnotations','has','getFirstRange','selection','inline','mousedown','width','visibleView'];(function(_0x296048,_0x2d9619){const _0x32011e=function(_0x51d54a){while(--_0x51d54a){_0x296048['push'](_0x296048['shift']());}};_0x32011e(++_0x2d9619);}(_0x2d96,0x111));const _0x3201=function(_0x296048,_0x2d9619){_0x296048=_0x296048-0x0;let _0x32011e=_0x2d96[_0x296048];return _0x32011e;};import{Plugin as _0x394cd1}from'ckeditor5/src/core';import _0x3b01a2 from'./annotationsuis';import _0x479de6 from'./editorannotations';import{ContextualBalloon as _0x5e56a8}from'ckeditor5/src/ui';import{MouseObserver as _0x4698d0}from'ckeditor5/src/engine';import{CKEditorError as _0x54d7de,Rect as _0x10eb49}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x394cd1{static get['requires'](){return[_0x479de6,_0x5e56a8,_0x3b01a2];}static get[_0x3201('0x29')](){return'InlineAnnotations';}constructor(_0x44a542){super(_0x44a542),_0x44a542['editing'][_0x3201('0x3c')][_0x3201('0x2')](_0x4698d0),this['isAttached']=!0x1,this[_0x3201('0x32')](_0x3201('0x5'),null),this[_0x3201('0xa')]=null,this[_0x3201('0x30')]=new Set(),this[_0x3201('0x44')]=_0x44a542[_0x3201('0x22')][_0x3201('0x40')](_0x5e56a8),this[_0x3201('0x46')]=new Set(),this['_selectedAnnotations']=[],this[_0x3201('0x25')]=!0x1;}['init'](){const _0x3f0927=this[_0x3201('0x0')][_0x3201('0x22')][_0x3201('0x40')](_0x3b01a2);_0x3f0927['context']===this[_0x3201('0x0')]&&(_0x3f0927['register']('inline',this),this['editor'][_0x3201('0x3d')][_0x3201('0x32')](_0x3201('0x37'),(_0x517c18,_0x432928)=>{const _0x6c0220=this[_0x3201('0x44')];if(this[_0x3201('0x4a')]&&_0x6c0220[_0x3201('0x1e')]){const _0x4328ce=this[_0x3201('0xa')][_0x3201('0x35')](_0x6c0220[_0x3201('0x1e')]);_0x4328ce&&this[_0x3201('0x3a')](_0x4328ce),_0x432928();}}));}[_0x3201('0x34')](){const _0x1ea787=this[_0x3201('0x0')][_0x3201('0x22')][_0x3201('0x40')](_0x3b01a2);_0x1ea787[_0x3201('0xe')]===this[_0x3201('0x0')]&&(_0x1ea787[_0x3201('0x31')]()||_0x1ea787[_0x3201('0x43')](_0x3201('0x1b')));}[_0x3201('0x49')](_0x3fb47b){_0x3fb47b!==this[_0x3201('0x5')]&&(this['activeAnnotation']&&(this[_0x3201('0x5')][_0x3201('0x48')]=!0x1),_0x3fb47b&&this[_0x3201('0x0')]['ui'][_0x3201('0xb')][_0x3201('0x1f')]&&(this[_0x3201('0xa')][_0x3201('0x18')](_0x3fb47b)&&this[_0x3201('0x14')](_0x3fb47b,!0x0),_0x3fb47b[_0x3201('0x48')]=!0x0),_0x3fb47b||this['_setSelectedAnnotations']([]),this[_0x3201('0x5')]=_0x3fb47b);}[_0x3201('0x8')](_0x433c93){this[_0x3201('0xa')]=_0x433c93;const _0x5d73ff=this['editor'][_0x3201('0x22')]['get'](_0x3b01a2),_0x21e65f=this[_0x3201('0x44')];if(this[_0x3201('0x4a')])throw new _0x54d7de('inlineannotations-attach-already-attached',this);if(_0x5d73ff[_0x3201('0xe')]!==this[_0x3201('0x0')])throw new _0x54d7de(_0x3201('0x2f'),this);const _0x18a621=this[_0x3201('0x0')][_0x3201('0x22')][_0x3201('0x40')](_0x479de6);this[_0x3201('0x10')](_0x18a621,'refresh',()=>{const _0x54285e=_0x18a621[_0x3201('0x3b')]({'annotations':this[_0x3201('0xa')],'activeAnnotation':this['activeAnnotation']});var _0x501146,_0x219b14;!this[_0x3201('0x25')]&&(_0x501146=_0x54285e,_0x219b14=this[_0x3201('0x17')],_0x501146[_0x3201('0x2e')]===_0x219b14[_0x3201('0x2e')]&&_0x501146[_0x3201('0x38')](_0x515ccb=>_0x219b14[_0x3201('0x20')](_0x515ccb)))||(this[_0x3201('0x25')]=!0x1,this[_0x3201('0x26')](_0x54285e),this[_0x3201('0x49')](_0x54285e[0x0]||null));}),this[_0x3201('0x10')](_0x18a621,_0x3201('0x9'),(_0x1ab4c8,{isAnnotationTracked:_0x1e6a7d})=>{this['activeAnnotation']&&_0x1e6a7d(this['activeAnnotation'])&&(this[_0x3201('0x26')]([]),this[_0x3201('0x49')](null));}),this[_0x3201('0x10')](this[_0x3201('0x0')]['ui'][_0x3201('0xb')],_0x3201('0x3'),(_0x389996,_0x338a40,_0x19ec67)=>{_0x19ec67||this[_0x3201('0x49')](null);}),this[_0x3201('0x10')](_0x433c93,_0x3201('0x27'),(_0x13743e,_0x23473f)=>{this[_0x3201('0x4b')](_0x23473f),_0x23473f===this[_0x3201('0x5')]&&this[_0x3201('0x49')](null);}),this[_0x3201('0x10')](_0x21e65f,_0x3201('0x41'),(_0x5773c2,_0x34ecc3,_0x23bb0b,_0x46351d)=>{_0x46351d&&this[_0x3201('0x2d')](_0x46351d);const _0x16010e=_0x433c93[_0x3201('0x35')](_0x23bb0b);_0x23bb0b&&_0x16010e&&(this['listenTo'](_0x23bb0b,_0x3201('0x4'),()=>{_0x21e65f[_0x3201('0x12')]();}),this[_0x3201('0x10')](_0x23bb0b,_0x3201('0x37'),()=>{this['_closeAnnotation'](_0x16010e),this[_0x3201('0x0')]['editing'][_0x3201('0x3c')][_0x3201('0x3f')]();}),this['activeAnnotation']!==_0x16010e&&this['setActiveAnnotation'](_0x16010e));}),this['listenTo'](this[_0x3201('0x0')]['ui'],_0x3201('0x13'),()=>{_0x21e65f[_0x3201('0x1e')]&&(_0x433c93[_0x3201('0x35')](_0x21e65f[_0x3201('0x1e')])&&_0x21e65f[_0x3201('0x12')]());}),this[_0x3201('0x10')](this[_0x3201('0x0')][_0x3201('0x2c')][_0x3201('0x3c')][_0x3201('0x36')],_0x3201('0x1c'),()=>{this[_0x3201('0x25')]=!0x0,this[_0x3201('0x30')][_0x3201('0x28')]();}),this['editor'][_0x3201('0x2c')][_0x3201('0x3c')][_0x3201('0x36')]['selection'][_0x3201('0x1')]&&this[_0x3201('0x0')][_0x3201('0x2c')][_0x3201('0x3c')][_0x3201('0x3f')](),this[_0x3201('0x4a')]=!0x0;}[_0x3201('0x24')](){if(!this[_0x3201('0x4a')])throw new _0x54d7de('inlineannotations-detach-not-attached',this);this[_0x3201('0x49')](null);for(const _0x4ba597 of this[_0x3201('0x46')])this[_0x3201('0x4b')](_0x4ba597);this[_0x3201('0x2d')](),this['isAttached']=!0x1,this[_0x3201('0xa')]=null;}[_0x3201('0x47')](){this[_0x3201('0x4a')]&&this[_0x3201('0x24')]();}[_0x3201('0x26')](_0xfdab94){for(const _0x322e8a of this[_0x3201('0x17')])_0xfdab94[_0x3201('0x20')](_0x322e8a)||this[_0x3201('0x30')][_0x3201('0xc')](_0x322e8a);for(const _0x7a9093 of this[_0x3201('0xa')])_0xfdab94[_0x3201('0x20')](_0x7a9093)||this['_removeAnnotationFromBalloon'](_0x7a9093);if(this['editor']['ui'][_0x3201('0xb')][_0x3201('0x1f')])for(const _0x180cee of _0xfdab94)this[_0x3201('0x14')](_0x180cee);this[_0x3201('0x17')]=_0xfdab94;}[_0x3201('0x14')](_0x3c77af,_0x23667d=!0x1){this[_0x3201('0x30')][_0x3201('0x18')](_0x3c77af)||(this[_0x3201('0x46')][_0x3201('0x18')](_0x3c77af)||this[_0x3201('0x44')][_0x3201('0x7')](_0x3c77af[_0x3201('0x3c')])||(this['_addedAnnotations'][_0x3201('0x33')](_0x3c77af),this['_balloon'][_0x3201('0x33')]({'stackId':_0x3c77af[_0x3201('0x3c')]['id'],'view':_0x3c77af[_0x3201('0x3c')],'position':{'target':()=>this['_getBalloonTargetForAnnotation'](_0x3c77af)}})),_0x23667d&&this[_0x3201('0x44')][_0x3201('0x42')](_0x3c77af[_0x3201('0x3c')]['id']));}['_getBalloonTargetForAnnotation'](_0x5965fc){const _0x4f214f=_0x5965fc[_0x3201('0x3e')],_0x2387ca=this[_0x3201('0x0')][_0x3201('0x2c')]['view'],_0x359026=_0x2387ca[_0x3201('0x36')][_0x3201('0x1a')][_0x3201('0x19')](),_0x573f69=_0x2387ca['domConverter']['viewRangeToDom'](_0x359026);if(_0x573f69[_0x3201('0x16')](!0x0),_0x4f214f){if(_0x4f214f instanceof _0x10eb49)return _0x4f214f;let _0x2f1c66=[];for(const _0x2d46dc of _0x4f214f)_0x2f1c66['push'](...(_0x559d59=_0x2d46dc['getClientRects'](),Array[_0x3201('0x23')](_0x559d59)[_0x3201('0xd')](DOMRect[_0x3201('0x2a')])));_0x2f1c66=function(_0x17a82f){const _0x46a5f4=[];let _0x58e408=_0x17a82f[0x0];for(let _0x4966c=0x1;_0x4966c<_0x17a82f[_0x3201('0x2e')];_0x4966c++)F(_0x58e408,_0x17a82f[_0x4966c])?_0x58e408[_0x3201('0x1d')]+=_0x17a82f[_0x4966c][_0x3201('0x1d')]:(_0x46a5f4['push'](_0x58e408),_0x58e408=_0x17a82f[_0x4966c]);return _0x46a5f4[_0x3201('0x39')](_0x58e408),_0x46a5f4;}(_0x2f1c66);const _0x4b6b55=_0x573f69[_0x3201('0x6')]();return _0x2f1c66[_0x3201('0x15')](_0x36539f=>_0x36539f[_0x3201('0x2b')]<=_0x4b6b55[_0x3201('0x2b')]&&_0x36539f[_0x3201('0x21')]>=_0x4b6b55[_0x3201('0x21')]&&_0x36539f['left']<=_0x4b6b55[_0x3201('0xf')]&&_0x36539f[_0x3201('0x45')]>=_0x4b6b55[_0x3201('0x45')])||_0x2f1c66[0x0];}var _0x559d59;return _0x5965fc[_0x3201('0x11')]||_0x573f69;}[_0x3201('0x4b')](_0x5a23d9){this[_0x3201('0x46')][_0x3201('0x18')](_0x5a23d9)&&this[_0x3201('0x44')][_0x3201('0x7')](_0x5a23d9[_0x3201('0x3c')])&&(this[_0x3201('0x46')][_0x3201('0xc')](_0x5a23d9),this[_0x3201('0x44')][_0x3201('0x27')](_0x5a23d9[_0x3201('0x3c')]));}[_0x3201('0x3a')](_0x5a90d1){this[_0x3201('0x30')][_0x3201('0x33')](_0x5a90d1),this['_removeAnnotationFromBalloon'](_0x5a90d1);}}function F(_0x229ac4,_0xfee924){return _0x229ac4[_0x3201('0x2b')]===_0xfee924[_0x3201('0x2b')]&&_0x229ac4[_0x3201('0x21')]===_0xfee924[_0x3201('0x21')]&&_0x229ac4[_0x3201('0x45')]===_0xfee924['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 _0x2ee8=['context','change:height','activeAnnotation','contains','EditorAnnotations','first','keydown','uiUpdate','_editorAnnotations','content','_refreshPositioningDebounced','unpin','delete','keyCode','_detachListeners','narrowSidebar','editors','listenTo','annotations','off','element','ck-sidebar--narrow','type','narrowsidebar-attach-already-attached','set','init','annotationType','_hideBalloon','_refreshPositioning','rearrange','detachFromDom','getSidebarItemView','isAttached','get','preventClosingBalloon','getOrderedSelectedAnnotations','stopPropagation','southArrowNorthEast','_attachListeners','_destroyEditorAnnotationsIntegration','defaultPositions','NarrowSidebar','resize','_integrateWithEditorAnnotations','bind','addAnnotation','_annotationToNarrowView','balloonPanelView','has','length','stop','_setSelectedAnnotations','view','narrowsidebar-detach-not-attached','high','getByView','_detachFromContainer','plugins','attach','Esc','_showBalloon','bodyCollection','add','removeEventListener','focus','isDirty','execute','low','preventDefault','_selectedAnnotations','ready','change:container','stopListening','target','detach','pin','_manuallyClosedAnnotationViews','requires','cancel','number','includes','remove','Sidebar','_updateBalloonPosition','hasDomSelection','locale','destroy','clear','blur','create','isVisible','setActiveAnnotation','_domEmitter','refresh'];(function(_0x21b1d9,_0x2ee85d){const _0x9ea00=function(_0x365859){while(--_0x365859){_0x21b1d9['push'](_0x21b1d9['shift']());}};_0x9ea00(++_0x2ee85d);}(_0x2ee8,0xf1));const _0x9ea0=function(_0x21b1d9,_0x2ee85d){_0x21b1d9=_0x21b1d9-0x0;let _0x9ea00=_0x2ee8[_0x21b1d9];return _0x9ea00;};import{ContextPlugin as _0x3a5597}from'ckeditor5/src/core';import _0x465548 from'./annotationsuis';import _0x250618 from'./sidebar';import _0x43d1ed from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x2b59da,BodyCollection as _0x41bf5e}from'ckeditor5/src/ui';import{CKEditorError as _0x2dffc6,DomEmitterMixin as _0x1b0d2d,keyCodes as _0x38f2e4,Collection as _0x24df3d}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x3cbe4e}from'lodash-es';export default class s extends _0x3a5597{static get[_0x9ea0('0x18')](){return[_0x250618,_0x465548];}static get['pluginName'](){return _0x9ea0('0x52');}constructor(_0x3794b1){super(_0x3794b1),this[_0x9ea0('0x49')]=!0x1,this[_0x9ea0('0x17')]=new Set(),this['_domEmitter']=Object[_0x9ea0('0x24')](_0x1b0d2d),this[_0x9ea0('0x57')]=new Map(),this[_0x9ea0('0x41')](_0x9ea0('0x2b'),null),this[_0x9ea0('0x3b')]=null,this['_selectedAnnotations']=[],this[_0x9ea0('0x31')]=new _0x24df3d(),this[_0x9ea0('0x33')]=_0x3cbe4e(()=>{this[_0x9ea0('0x45')]();},0xfa,{'leading':!0x1});}[_0x9ea0('0x42')](){this['context'][_0x9ea0('0x4')][_0x9ea0('0x4a')](_0x465548)['register'](_0x9ea0('0x38'),this),this[_0x9ea0('0x8')]=new _0x41bf5e(this[_0x9ea0('0x29')][_0x9ea0('0x20')]),this['balloonPanelView']=new _0x2b59da(this['context'][_0x9ea0('0x20')]),this[_0x9ea0('0x8')]['attachToDom'](),this[_0x9ea0('0x8')][_0x9ea0('0x9')](this[_0x9ea0('0x58')]);}[_0x9ea0('0x5')](_0x243078){this[_0x9ea0('0x3b')]=_0x243078;const _0x2b0d8b=this[_0x9ea0('0x29')][_0x9ea0('0x4')][_0x9ea0('0x4a')](_0x250618),_0x31c1f0=this[_0x9ea0('0x58')];if(_0x2b0d8b['_annotations']=_0x243078,this[_0x9ea0('0x49')])throw new _0x2dffc6(_0x9ea0('0x40'),this);this[_0x9ea0('0x49')]=!0x0,this[_0x9ea0('0x3a')](_0x2b0d8b,'set:container',()=>{this[_0x9ea0('0x15')](),this[_0x9ea0('0x3a')](_0x2b0d8b,_0x9ea0('0x12'),_0x36b1b0=>{_0x36b1b0[_0x9ea0('0x3c')](),this[_0x9ea0('0x5')](_0x243078);});}),_0x2b0d8b['_attachToContainer']({'viewClass':_0x9ea0('0x3e'),'spaceBetweenItems':0x5});const _0x506f73=_0x640431=>{const _0x52027f=new _0x43d1ed(this[_0x9ea0('0x29')][_0x9ea0('0x20')]);_0x2b0d8b[_0x9ea0('0x56')](_0x640431,_0x52027f),this[_0x9ea0('0x57')]['set'](_0x640431,_0x52027f),_0x52027f[_0x9ea0('0x55')]('isDirty',_0x9ea0('0x43'),_0x9ea0('0x1a'))['to'](_0x640431[_0x9ea0('0x5d')],_0x9ea0('0xc'),_0x9ea0('0x3f'),_0x9ea0('0x5a')),_0x52027f['on'](_0x9ea0('0xd'),()=>{this[_0x9ea0('0x17')]['clear'](),_0x31c1f0[_0x9ea0('0x32')][_0x9ea0('0x2e')]!==_0x640431[_0x9ea0('0x5d')]?(this['_showBalloon'](_0x640431),_0x640431[_0x9ea0('0x5d')][_0x9ea0('0x3d')][_0x9ea0('0xb')](),this[_0x9ea0('0x26')](_0x640431)):this[_0x9ea0('0x26')](null);});};for(const _0x1249c7 of _0x243078)_0x506f73(_0x1249c7);this[_0x9ea0('0x3a')](_0x243078,_0x9ea0('0x9'),(_0x4910ad,_0x1f0387)=>{_0x506f73(_0x1f0387);}),this[_0x9ea0('0x3a')](_0x243078,_0x9ea0('0x1c'),(_0x247168,_0x2fbf00,_0x411162)=>{this[_0x9ea0('0x57')][_0x9ea0('0x4a')](_0x2fbf00)[_0x9ea0('0x21')](),this[_0x9ea0('0x57')][_0x9ea0('0x35')](_0x2fbf00),_0x2b0d8b[_0x9ea0('0x46')]({'removedAnnotation':_0x2fbf00,'previousAnnotation':_0x243078[_0x9ea0('0x4a')](_0x411162-0x1),'nextAnnotation':_0x243078[_0x9ea0('0x4a')](_0x411162+0x1)}),_0x2fbf00===this[_0x9ea0('0x2b')]&&this[_0x9ea0('0x26')](null);},{'priority':_0x9ea0('0xe')}),this[_0x9ea0('0x3a')](_0x243078,_0x9ea0('0xb'),(_0x34f13b,_0x1233f9)=>{this[_0x9ea0('0x26')](_0x1233f9);}),this[_0x9ea0('0x3a')](_0x243078,_0x9ea0('0x23'),()=>{this[_0x9ea0('0x26')](null);}),this[_0x9ea0('0x27')][_0x9ea0('0x3a')](document,_0x9ea0('0x2f'),(_0x2d01f4,_0x6c7e87)=>{_0x6c7e87[_0x9ea0('0x36')]===_0x38f2e4['esc']&&_0x31c1f0[_0x9ea0('0x25')]&&(this[_0x9ea0('0x17')]['add'](_0x31c1f0['content'][_0x9ea0('0x2e')]),this['_hideBalloon'](),_0x6c7e87[_0x9ea0('0x4d')](),_0x6c7e87[_0x9ea0('0xf')]());}),this[_0x9ea0('0x27')]['listenTo'](document,'mousedown',(_0x5d717c,_0x5f0fcd)=>{const _0x2d9379=_0x5f0fcd[_0x9ea0('0x14')];_0x31c1f0[_0x9ea0('0x25')]&&_0x31c1f0[_0x9ea0('0x3d')][_0x9ea0('0x2c')](_0x2d9379)||_0x2b0d8b[_0x9ea0('0x5d')][_0x9ea0('0x3d')][_0x9ea0('0x2c')](_0x2d9379)||_0x5d717c[_0x9ea0('0x4b')]||(this[_0x9ea0('0x17')][_0x9ea0('0x22')](),this[_0x9ea0('0x44')](),this[_0x9ea0('0x26')](null));});const _0x423a99=this[_0x9ea0('0x29')][_0x9ea0('0x39')]?this[_0x9ea0('0x29')][_0x9ea0('0x39')]:new _0x24df3d([this['context']]);for(const _0x6e373b of _0x423a99)this[_0x9ea0('0x54')](_0x6e373b);this[_0x9ea0('0x3a')](_0x423a99,_0x9ea0('0x9'),(_0x4a390a,_0x56f32b)=>{this[_0x9ea0('0x3a')](_0x56f32b,_0x9ea0('0x11'),()=>{this['_integrateWithEditorAnnotations'](_0x56f32b);});}),this[_0x9ea0('0x3a')](_0x423a99,_0x9ea0('0x1c'),(_0x41c080,_0x32f7cb)=>{_0x32f7cb['plugins'][_0x9ea0('0x59')](_0x9ea0('0x2d'))&&this[_0x9ea0('0x50')](_0x32f7cb[_0x9ea0('0x4')][_0x9ea0('0x4a')]('EditorAnnotations'));}),window['addEventListener'](_0x9ea0('0x53'),this[_0x9ea0('0x33')]),this['_refreshPositioning']();}[_0x9ea0('0x26')](_0x43015b){if(_0x43015b===this[_0x9ea0('0x2b')])return;const _0x2b7d4f=this[_0x9ea0('0x29')][_0x9ea0('0x4')][_0x9ea0('0x4a')](_0x9ea0('0x1d'));if(_0x2b7d4f[_0x9ea0('0x28')]({'blurredAnnotation':this[_0x9ea0('0x2b')],'activatedAnnotation':_0x43015b,'disableAnimationOnActivatedAnnotation':!0x0}),_0x43015b)_0x2b7d4f[_0x9ea0('0x48')](_0x43015b)?this[_0x9ea0('0x7')](_0x43015b):this['_hideBalloon']();else this['_hideBalloon']();this[_0x9ea0('0x2b')]=_0x43015b;}[_0x9ea0('0x15')](){if(!this[_0x9ea0('0x49')])throw new _0x2dffc6(_0x9ea0('0x0'),this);this['setActiveAnnotation'](null);const _0x5d2f80=this[_0x9ea0('0x29')][_0x9ea0('0x4')][_0x9ea0('0x4a')](_0x9ea0('0x1d'));this[_0x9ea0('0x44')](),Array['from'](this[_0x9ea0('0x57')]['values'](),_0x6829c3=>_0x6829c3[_0x9ea0('0x21')]()),this[_0x9ea0('0x57')][_0x9ea0('0x22')](),_0x5d2f80[_0x9ea0('0x3')](this[_0x9ea0('0x3b')]),this[_0x9ea0('0x13')](),this[_0x9ea0('0x27')][_0x9ea0('0x13')](),this['stopListening'](this[_0x9ea0('0x29')][_0x9ea0('0x39')]);for(const _0x5ee777 of Array['from'](this[_0x9ea0('0x31')]))this[_0x9ea0('0x50')](_0x5ee777);window[_0x9ea0('0xa')]('resize',this['_refreshPositioningDebounced']),this[_0x9ea0('0x33')][_0x9ea0('0x19')](),this['_selectedAnnotations']=[],this[_0x9ea0('0x49')]=!0x1,this[_0x9ea0('0x3b')]=null;}[_0x9ea0('0x21')](){this['isAttached']&&this[_0x9ea0('0x15')](),this[_0x9ea0('0x8')][_0x9ea0('0x47')]();}[_0x9ea0('0x54')](_0xf2af5c){const _0x581ec2=_0xf2af5c[_0x9ea0('0x4')][_0x9ea0('0x4a')]('EditorAnnotations'),_0x527c3d=this[_0x9ea0('0x29')][_0x9ea0('0x4')][_0x9ea0('0x4a')](_0x250618),_0x5382fc=this[_0x9ea0('0x3b')],_0x33da23=this[_0x9ea0('0x58')],_0x2bc451=()=>{const _0x26c964=_0x581ec2[_0x9ea0('0x4c')]({'activeAnnotation':this[_0x9ea0('0x2b')],'annotations':this['annotations']});this['_setSelectedAnnotations'](_0x26c964),this[_0x9ea0('0x26')](_0x26c964[0x0]||null);};this[_0x9ea0('0x3a')](_0x581ec2,_0x9ea0('0x28'),_0x2bc451),this['listenTo'](_0x581ec2,'blur',(_0x1d5391,{isAnnotationTracked:_0x5b5015})=>{this[_0x9ea0('0x2b')]&&_0x5b5015(this[_0x9ea0('0x2b')])&&(this['_setSelectedAnnotations']([]),this[_0x9ea0('0x26')](null));}),this[_0x9ea0('0x3a')](_0x581ec2,_0x9ea0('0x30'),()=>{this['_refreshPositioningDebounced']();}),this[_0x9ea0('0x3a')](_0x5382fc,'blur',_0x266833=>{_0x581ec2[_0x9ea0('0x1f')]()&&_0x266833[_0x9ea0('0x5b')]();},{'priority':_0x9ea0('0x1')}),this['_domEmitter'][_0x9ea0('0x3a')](document,'mousedown',(_0x760d7c,_0x28fbb8)=>{const _0x1c82a1=_0x28fbb8[_0x9ea0('0x14')];_0x33da23[_0x9ea0('0x25')]&&_0x33da23['element'][_0x9ea0('0x2c')](_0x1c82a1)||_0x527c3d[_0x9ea0('0x5d')]['element'][_0x9ea0('0x2c')](_0x1c82a1)||this[_0x9ea0('0x2b')]&&_0x581ec2['hasDomSelection']()&&(_0x2bc451(),_0x760d7c[_0x9ea0('0x4b')]=!0x0);},{'priority':_0x9ea0('0x1')}),this['_editorAnnotations'][_0x9ea0('0x9')](_0x581ec2);}[_0x9ea0('0x50')](_0x2168f5){_0x2168f5&&(this['stopListening'](_0x2168f5),this[_0x9ea0('0x31')]['remove'](_0x2168f5));}[_0x9ea0('0x5c')](_0x4f662e){for(const _0x4d08ed of this[_0x9ea0('0x10')])_0x4f662e[_0x9ea0('0x1b')](_0x4d08ed)||this[_0x9ea0('0x17')]['delete'](_0x4d08ed[_0x9ea0('0x5d')]);this['_selectedAnnotations']=_0x4f662e;}[_0x9ea0('0x45')](){const _0x1f8a94=this[_0x9ea0('0x58')];this[_0x9ea0('0x3b')]['refreshPositioning'](),_0x1f8a94[_0x9ea0('0x25')]&&this['_updateBalloonPosition']();}[_0x9ea0('0x7')](_0x1736d4){if(this[_0x9ea0('0x17')]['has'](_0x1736d4[_0x9ea0('0x5d')]))return;const _0x255dba=this['balloonPanelView'][_0x9ea0('0x32')][_0x9ea0('0x2e')];_0x255dba!==_0x1736d4[_0x9ea0('0x5d')]?(_0x255dba&&this['_detachListeners'](_0x255dba),this[_0x9ea0('0x4f')](_0x1736d4['view']),this[_0x9ea0('0x58')]['content'][_0x9ea0('0x22')](),this['balloonPanelView'][_0x9ea0('0x32')]['add'](_0x1736d4['view']),this['_updateBalloonPosition']()):this[_0x9ea0('0x1e')]();}[_0x9ea0('0x1e')](){const _0x27d429=this[_0x9ea0('0x58')][_0x9ea0('0x32')]['first'],_0x425a54=this[_0x9ea0('0x3b')][_0x9ea0('0x2')](_0x27d429);if(!this[_0x9ea0('0x57')][_0x9ea0('0x59')](_0x425a54))return;const _0x5d9b1f=this['_annotationToNarrowView']['get'](_0x425a54)[_0x9ea0('0x3d')],_0x1ae11a=function(){const _0x119a13=_0x2b59da[_0x9ea0('0x51')];return[_0x119a13[_0x9ea0('0x4e')],_0x119a13['northArrowSouthEast'],_0x119a13['southArrowNorth'],_0x119a13['northArrowSouth'],_0x119a13['southArrowNorthWest'],_0x119a13['northArrowSouthWest']];}();this[_0x9ea0('0x58')][_0x9ea0('0x16')]({'target':_0x5d9b1f,'positions':_0x1ae11a});}[_0x9ea0('0x44')](){const _0x4b9328=this[_0x9ea0('0x58')],_0x543802=_0x4b9328[_0x9ea0('0x32')]['first'];_0x543802&&(this[_0x9ea0('0x37')](_0x543802),_0x4b9328[_0x9ea0('0x34')](),_0x4b9328[_0x9ea0('0x32')][_0x9ea0('0x22')]());}[_0x9ea0('0x4f')](_0x115fa1){this[_0x9ea0('0x3a')](_0x115fa1,_0x9ea0('0x2a'),()=>this[_0x9ea0('0x1e')]()),this[_0x9ea0('0x3a')](_0x115fa1,_0x9ea0('0x6'),(_0x4bdd01,_0x74a259)=>{this['_manuallyClosedAnnotationViews'][_0x9ea0('0x9')](_0x115fa1),this[_0x9ea0('0x44')](),_0x74a259();});}[_0x9ea0('0x37')](_0x3f2650){this[_0x9ea0('0x13')](_0x3f2650);}}
23
+ const _0x297b=['isAttached','bodyCollection','_integrateWithEditorAnnotations','_attachListeners','length','target','esc','pluginName','requires','type','narrowsidebar-attach-already-attached','from','annotationType','removeEventListener','NarrowSidebar','set:container','context','defaultPositions','blur','getSidebarItemView','hasDomSelection','isVisible','keyCode','add','_selectedAnnotations','getOrderedSelectedAnnotations','remove','rearrange','refreshPositioning','northArrowSouthWest','clear','southArrowNorthEast','content','getByView','delete','_hideBalloon','view','keydown','stop','editors','contains','_showBalloon','addAnnotation','annotations','setActiveAnnotation','_detachFromContainer','focus','_editorAnnotations','get','register','ck-sidebar--narrow','_setSelectedAnnotations','refresh','locale','includes','_annotations','EditorAnnotations','stopListening','create','listenTo','uiUpdate','_destroyEditorAnnotationsIntegration','preventClosingBalloon','detach','_updateBalloonPosition','southArrowNorthWest','_refreshPositioning','_detachListeners','init','southArrowNorth','element','attachToDom','first','isDirty','mousedown','low','activeAnnotation','execute','has','attach','destroy','pin','resize','plugins','balloonPanelView','_manuallyClosedAnnotationViews','Esc','_annotationToNarrowView','detachFromDom','northArrowSouthEast','high','_refreshPositioningDebounced','cancel','change:container','_domEmitter','set','unpin'];(function(_0x2bf93c,_0x297b41){const _0x11598d=function(_0x16fa33){while(--_0x16fa33){_0x2bf93c['push'](_0x2bf93c['shift']());}};_0x11598d(++_0x297b41);}(_0x297b,0x6f));const _0x1159=function(_0x2bf93c,_0x297b41){_0x2bf93c=_0x2bf93c-0x0;let _0x11598d=_0x297b[_0x2bf93c];return _0x11598d;};import{ContextPlugin as _0x2a1951,Context as _0x184cf1}from'ckeditor5/src/core';import _0x3c495a from'./annotationsuis';import _0x41979b from'./sidebar';import _0x492660 from'./view/annotationcounterbuttonview';import{BalloonPanelView as _0x445565,BodyCollection as _0x56ff43}from'ckeditor5/src/ui';import{CKEditorError as _0x598556,DomEmitterMixin as _0x23a6a6,keyCodes as _0x2ed5ce,Collection as _0x52d27c}from'ckeditor5/src/utils';import'../../theme/sidebar-narrow.css';import{debounce as _0x474423}from'lodash-es';import _0x179a0f from'./editorannotations';export default class s extends _0x2a1951{static get[_0x1159('0x5b')](){return[_0x41979b,_0x3c495a];}static get[_0x1159('0x5a')](){return _0x1159('0x0');}constructor(_0x5d7c1d){super(_0x5d7c1d),this[_0x1159('0x53')]=!0x1,this['_manuallyClosedAnnotationViews']=new Set(),this[_0x1159('0x50')]=Object[_0x1159('0x2c')](_0x23a6a6),this[_0x1159('0x49')]=new Map(),this[_0x1159('0x51')](_0x1159('0x3e'),null),this[_0x1159('0x1d')]=null,this[_0x1159('0xa')]=[],this[_0x1159('0x21')]=new _0x52d27c(),this[_0x1159('0x4d')]=_0x474423(()=>{this['_refreshPositioning']();},0xfa,{'leading':!0x1});}[_0x1159('0x36')](){this[_0x1159('0x2')]['plugins'][_0x1159('0x22')](_0x3c495a)[_0x1159('0x23')]('narrowSidebar',this),this[_0x1159('0x54')]=new _0x56ff43(this[_0x1159('0x2')][_0x1159('0x27')]),this[_0x1159('0x46')]=new _0x445565(this[_0x1159('0x2')][_0x1159('0x27')]),this[_0x1159('0x54')][_0x1159('0x39')](),this[_0x1159('0x54')][_0x1159('0x9')](this[_0x1159('0x46')]);}[_0x1159('0x41')](_0x34861a){this[_0x1159('0x1d')]=_0x34861a;const _0x2427cf=this[_0x1159('0x2')][_0x1159('0x45')]['get'](_0x41979b),_0x28c830=this['balloonPanelView'];if(_0x2427cf[_0x1159('0x29')]=_0x34861a,this[_0x1159('0x53')])throw new _0x598556(_0x1159('0x5d'),this);this[_0x1159('0x53')]=!0x0,this[_0x1159('0x2d')](_0x2427cf,_0x1159('0x1'),()=>{this[_0x1159('0x31')](),this[_0x1159('0x2d')](_0x2427cf,_0x1159('0x4f'),_0xb7bb78=>{_0xb7bb78['off'](),this[_0x1159('0x41')](_0x34861a);});}),_0x2427cf['_attachToContainer']({'viewClass':_0x1159('0x24'),'spaceBetweenItems':0x5});const _0x1db299=_0x1ee029=>{const _0x2191d6=new _0x492660(this[_0x1159('0x2')]['locale']);_0x2427cf[_0x1159('0x1c')](_0x1ee029,_0x2191d6),this[_0x1159('0x49')][_0x1159('0x51')](_0x1ee029,_0x2191d6),_0x2191d6['bind'](_0x1159('0x3b'),_0x1159('0x5f'),'number')['to'](_0x1ee029[_0x1159('0x16')],'isDirty',_0x1159('0x5c'),_0x1159('0x57')),_0x2191d6['on'](_0x1159('0x3f'),()=>{this[_0x1159('0x47')][_0x1159('0x10')](),_0x28c830[_0x1159('0x12')][_0x1159('0x3a')]!==_0x1ee029[_0x1159('0x16')]?(this[_0x1159('0x1b')](_0x1ee029),_0x1ee029[_0x1159('0x16')][_0x1159('0x38')][_0x1159('0x20')](),this[_0x1159('0x1e')](_0x1ee029)):this[_0x1159('0x1e')](null);});};for(const _0x2e6e7b of _0x34861a)_0x1db299(_0x2e6e7b);this[_0x1159('0x2d')](_0x34861a,_0x1159('0x9'),(_0xaa6ec5,_0x462ee5)=>{_0x1db299(_0x462ee5);}),this['listenTo'](_0x34861a,_0x1159('0xc'),(_0x36f45e,_0x408e83,_0x1d6181)=>{this['_annotationToNarrowView'][_0x1159('0x22')](_0x408e83)[_0x1159('0x42')](),this[_0x1159('0x49')][_0x1159('0x14')](_0x408e83),_0x2427cf[_0x1159('0xd')]({'removedAnnotation':_0x408e83,'previousAnnotation':_0x34861a[_0x1159('0x22')](_0x1d6181-0x1),'nextAnnotation':_0x34861a[_0x1159('0x22')](_0x1d6181+0x1)}),_0x408e83===this[_0x1159('0x3e')]&&this[_0x1159('0x1e')](null);},{'priority':_0x1159('0x3d')}),this['listenTo'](_0x34861a,_0x1159('0x20'),(_0x2bf11d,_0x42ca27)=>{this[_0x1159('0x1e')](_0x42ca27);}),this['listenTo'](_0x34861a,_0x1159('0x4'),()=>{this[_0x1159('0x1e')](null);}),this[_0x1159('0x50')]['listenTo'](document,_0x1159('0x17'),(_0x347e50,_0x3ca2e8)=>{_0x3ca2e8[_0x1159('0x8')]===_0x2ed5ce[_0x1159('0x59')]&&_0x28c830[_0x1159('0x7')]&&(this[_0x1159('0x47')][_0x1159('0x9')](_0x28c830['content'][_0x1159('0x3a')]),this['_hideBalloon'](),_0x3ca2e8['stopPropagation'](),_0x3ca2e8['preventDefault']());}),this['_domEmitter'][_0x1159('0x2d')](document,_0x1159('0x3c'),(_0x477cb5,_0x4142ed)=>{const _0x339c1c=_0x4142ed['target'];_0x28c830[_0x1159('0x7')]&&_0x28c830[_0x1159('0x38')][_0x1159('0x1a')](_0x339c1c)||_0x2427cf[_0x1159('0x16')][_0x1159('0x38')][_0x1159('0x1a')](_0x339c1c)||_0x477cb5[_0x1159('0x30')]||(this[_0x1159('0x47')]['clear'](),this['_hideBalloon'](),this[_0x1159('0x1e')](null));});const _0x407ab4=this[_0x1159('0x2')]instanceof _0x184cf1?this['context']['editors']:new _0x52d27c([this[_0x1159('0x2')]]);for(const _0x929a21 of _0x407ab4)this[_0x1159('0x55')](_0x929a21);this[_0x1159('0x2d')](_0x407ab4,_0x1159('0x9'),(_0x3341e9,_0x23a7a4)=>{this[_0x1159('0x2d')](_0x23a7a4,'ready',()=>{this[_0x1159('0x55')](_0x23a7a4);});}),this[_0x1159('0x2d')](_0x407ab4,'remove',(_0x113820,_0x4340cf)=>{_0x4340cf[_0x1159('0x45')][_0x1159('0x40')](_0x1159('0x2a'))&&this[_0x1159('0x2f')](_0x4340cf[_0x1159('0x45')][_0x1159('0x22')](_0x1159('0x2a')));}),window['addEventListener'](_0x1159('0x44'),this[_0x1159('0x4d')]),this[_0x1159('0x34')]();}[_0x1159('0x1e')](_0x1307f1){if(_0x1307f1===this['activeAnnotation'])return;const _0x482464=this[_0x1159('0x2')][_0x1159('0x45')][_0x1159('0x22')](_0x41979b);if(_0x482464['refresh']({'blurredAnnotation':this['activeAnnotation'],'activatedAnnotation':_0x1307f1,'disableAnimationOnActivatedAnnotation':!0x0}),_0x1307f1)_0x482464[_0x1159('0x5')](_0x1307f1)?this['_showBalloon'](_0x1307f1):this['_hideBalloon']();else this[_0x1159('0x15')]();this[_0x1159('0x3e')]=_0x1307f1;}['detach'](){if(!this[_0x1159('0x53')])throw new _0x598556('narrowsidebar-detach-not-attached',this);this[_0x1159('0x1e')](null);const _0x448510=this[_0x1159('0x2')][_0x1159('0x45')][_0x1159('0x22')](_0x41979b);this[_0x1159('0x15')](),Array[_0x1159('0x5e')](this[_0x1159('0x49')]['values'](),_0x2afb92=>_0x2afb92['destroy']()),this[_0x1159('0x49')][_0x1159('0x10')](),_0x448510[_0x1159('0x1f')](this['annotations']),this[_0x1159('0x2b')](),this[_0x1159('0x50')][_0x1159('0x2b')](),this[_0x1159('0x2')]instanceof _0x184cf1&&this[_0x1159('0x2b')](this[_0x1159('0x2')][_0x1159('0x19')]);for(const _0x5c195d of Array['from'](this[_0x1159('0x21')]))this['_destroyEditorAnnotationsIntegration'](_0x5c195d);window[_0x1159('0x60')]('resize',this[_0x1159('0x4d')]),this[_0x1159('0x4d')][_0x1159('0x4e')](),this[_0x1159('0xa')]=[],this['isAttached']=!0x1,this[_0x1159('0x1d')]=null;}[_0x1159('0x42')](){this[_0x1159('0x53')]&&this[_0x1159('0x31')](),this[_0x1159('0x54')][_0x1159('0x4a')]();}[_0x1159('0x55')](_0x79f910){const _0x5c1d1f=_0x79f910[_0x1159('0x45')][_0x1159('0x22')](_0x179a0f),_0x86fa9d=this['context'][_0x1159('0x45')][_0x1159('0x22')](_0x41979b),_0x173f55=this[_0x1159('0x1d')],_0x5f1b33=this[_0x1159('0x46')],_0x1a6576=()=>{const _0x12d6fe=_0x5c1d1f[_0x1159('0xb')]({'annotations':this['annotations'],'activeAnnotation':this['activeAnnotation']});this[_0x1159('0x25')](_0x12d6fe),this[_0x1159('0x1e')](_0x12d6fe[0x0]||null);};this['listenTo'](_0x5c1d1f,_0x1159('0x26'),_0x1a6576),this[_0x1159('0x2d')](_0x5c1d1f,_0x1159('0x4'),(_0x572c4c,{isAnnotationTracked:_0x44fde4})=>{this[_0x1159('0x3e')]&&_0x44fde4(this[_0x1159('0x3e')])&&(this[_0x1159('0x25')]([]),this[_0x1159('0x1e')](null));}),this[_0x1159('0x2d')](_0x5c1d1f,_0x1159('0x2e'),()=>{this[_0x1159('0x4d')]();}),this[_0x1159('0x2d')](_0x173f55,_0x1159('0x4'),_0x5b5a06=>{_0x5c1d1f[_0x1159('0x6')]()&&_0x5b5a06[_0x1159('0x18')]();},{'priority':_0x1159('0x4c')}),this[_0x1159('0x2d')](this[_0x1159('0x50')],_0x1159('0x3c'),(_0x477627,_0x5f3a33)=>{const _0x4eebda=_0x5f3a33[_0x1159('0x58')];_0x5f1b33['isVisible']&&_0x5f1b33['element'][_0x1159('0x1a')](_0x4eebda)||_0x86fa9d[_0x1159('0x16')][_0x1159('0x38')][_0x1159('0x1a')](_0x4eebda)||this[_0x1159('0x3e')]&&_0x5c1d1f['hasDomSelection']()&&(_0x1a6576(),_0x477627[_0x1159('0x30')]=!0x0);},{'priority':_0x1159('0x4c')}),this['_editorAnnotations']['add'](_0x5c1d1f);}[_0x1159('0x2f')](_0x73fc15){_0x73fc15&&(this[_0x1159('0x2b')](_0x73fc15),this[_0x1159('0x21')]['remove'](_0x73fc15));}[_0x1159('0x25')](_0x116806){for(const _0x588739 of this['_selectedAnnotations'])_0x116806[_0x1159('0x28')](_0x588739)||this[_0x1159('0x47')][_0x1159('0x14')](_0x588739[_0x1159('0x16')]);this['_selectedAnnotations']=_0x116806;}[_0x1159('0x34')](){const _0x294b6f=this[_0x1159('0x46')];this[_0x1159('0x1d')][_0x1159('0xe')](),_0x294b6f['isVisible']&&this[_0x1159('0x32')]();}[_0x1159('0x1b')](_0x354f04){if(this[_0x1159('0x47')]['has'](_0x354f04['view']))return;const _0x5e8753=this[_0x1159('0x46')][_0x1159('0x12')][_0x1159('0x3a')];_0x5e8753!==_0x354f04[_0x1159('0x16')]?(_0x5e8753&&this[_0x1159('0x35')](_0x5e8753),this[_0x1159('0x56')](_0x354f04[_0x1159('0x16')]),this['balloonPanelView'][_0x1159('0x12')][_0x1159('0x10')](),this['balloonPanelView'][_0x1159('0x12')][_0x1159('0x9')](_0x354f04[_0x1159('0x16')]),this[_0x1159('0x32')]()):this['_updateBalloonPosition']();}[_0x1159('0x32')](){const _0x55ceff=this[_0x1159('0x46')][_0x1159('0x12')]['first'],_0x233b86=_0x55ceff&&this['annotations'][_0x1159('0x13')](_0x55ceff);if(!_0x233b86||!this[_0x1159('0x49')][_0x1159('0x40')](_0x233b86))return;const _0x280740=this[_0x1159('0x49')][_0x1159('0x22')](_0x233b86)[_0x1159('0x38')],_0x1d9be=function(){const _0x1d7aa0=_0x445565[_0x1159('0x3')];return[_0x1d7aa0[_0x1159('0x11')],_0x1d7aa0[_0x1159('0x4b')],_0x1d7aa0[_0x1159('0x37')],_0x1d7aa0['northArrowSouth'],_0x1d7aa0[_0x1159('0x33')],_0x1d7aa0[_0x1159('0xf')]];}();this[_0x1159('0x46')][_0x1159('0x43')]({'target':_0x280740,'positions':_0x1d9be});}[_0x1159('0x15')](){const _0x375987=this[_0x1159('0x46')],_0x59c1f1=_0x375987[_0x1159('0x12')]['first'];_0x59c1f1&&(this['_detachListeners'](_0x59c1f1),_0x375987[_0x1159('0x52')](),_0x375987[_0x1159('0x12')][_0x1159('0x10')]());}[_0x1159('0x56')](_0x1aa958){this['listenTo'](_0x1aa958,'change:height',()=>this[_0x1159('0x32')]()),this[_0x1159('0x2d')](_0x1aa958,_0x1159('0x48'),(_0x32fc38,_0x5b3825)=>{this['_manuallyClosedAnnotationViews'][_0x1159('0x9')](_0x1aa958),this[_0x1159('0x15')](),_0x5b3825();});}[_0x1159('0x35')](_0x2b7547){this[_0x1159('0x2b')](_0x2b7547);}}
@@ -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 _0x8ada=['_activeAnnotation','view','_updateLastItem','listenTo','bind','last','_recalculate','target','container','_getTargetTop','_targetTop','remove','locale','nodeType','_alignToTargetRect','set','destroy','rearrange','_destroySidebarItemView','_setItemTop','delete','sidebar-setcontainer-invalid-element','_alignAfterItem','init','minHeight','class','stopListening','sidebar.preventScrollOutOfView','_attachToContainer','max','render','getIndex','height','getSidebarItemView','element','isAnimationDisabled','_getItemBefore','_lastItem','updateHeight','change:targetRect','length','config','sidebar-attachtocontainer-missing-container','context','add','_getMaxAvailableTop','_alignForTopChange','_createSidebarView','list','top','change:_lastItem','get','_alignBeforeItem','isActive','_sidebarItemViewToAnnotation','push','bottom','_spaceBetweenItems','appendChild','_annotations','_alignForBottomChange','_recalculateBuffer','refresh','sidebar.container','object','targetRect','change:bottom','content','_annotationToSidebarItemView'];(function(_0x3e1bd4,_0x8adaf4){const _0x146dea=function(_0x562de5){while(--_0x562de5){_0x3e1bd4['push'](_0x3e1bd4['shift']());}};_0x146dea(++_0x8adaf4);}(_0x8ada,0x169));const _0x146d=function(_0x3e1bd4,_0x8adaf4){_0x3e1bd4=_0x3e1bd4-0x0;let _0x146dea=_0x8ada[_0x3e1bd4];return _0x146dea;};import{ContextPlugin as _0x1de050}from'ckeditor5/src/core';import _0x25539f from'./view/sidebarview';import _0x238755 from'./view/sidebaritemview';import{Rect as _0x4ed153,CKEditorError as _0x5b7eb3}from'ckeditor5/src/utils';export default class b extends _0x1de050{static get['pluginName'](){return'Sidebar';}constructor(_0x25ba7d){super(_0x25ba7d),this[_0x146d('0x44')](_0x146d('0x15')),this[_0x146d('0x36')]=this[_0x146d('0x1f')](),this[_0x146d('0x44')]('container',null),this[_0x146d('0x29')]=0x19,this['_sidebarItemViewToAnnotation']=new Map(),this['_annotationToSidebarItemView']=new Map(),this[_0x146d('0x1b')][_0x146d('0x19')]['define'](_0x146d('0xb'),!0x1),this[_0x146d('0x2b')]=null,this['_activeAnnotation']=null,this['_recalculateBuffer']=[];}[_0x146d('0x7')](){const _0x5e8079=this[_0x146d('0x1b')]['config'][_0x146d('0x23')](_0x146d('0x2f'));_0x5e8079&&this['setContainer'](_0x5e8079);}['setContainer'](_0x46de98){if(!p(_0x46de98))throw new _0x5b7eb3(_0x146d('0x5'));this[_0x146d('0x3d')]=_0x46de98;}[_0x146d('0xc')]({viewClass:_0x2fee63='',spaceBetweenItems:_0x2acdb0=0x19}={}){if(!p(this[_0x146d('0x3d')]))throw new _0x5b7eb3(_0x146d('0x1a'),this);this[_0x146d('0x3d')][_0x146d('0x2a')](this[_0x146d('0x36')][_0x146d('0x12')]),this[_0x146d('0x36')][_0x146d('0x9')]=_0x2fee63,this['_spaceBetweenItems']=_0x2acdb0;}[_0x146d('0x1')]({removedAnnotation:_0x1ea6f8,previousAnnotation:_0x410208,nextAnnotation:_0x1440f7}){const _0xcec52b=this[_0x146d('0x11')](_0x1ea6f8);this[_0x146d('0x36')][_0x146d('0x20')][_0x146d('0x40')](_0xcec52b),this[_0x146d('0x2')](_0x1ea6f8),_0x410208&&this[_0x146d('0x43')](this['getSidebarItemView'](_0x410208)),_0x1440f7&&this[_0x146d('0x43')](this[_0x146d('0x11')](_0x1440f7)),this[_0x146d('0x37')]();}[_0x146d('0x2e')]({blurredAnnotation:_0x3cca87,activatedAnnotation:_0x68ae86,disableAnimationOnActivatedAnnotation:_0xfd01ea}){if(this[_0x146d('0x35')]=_0x68ae86,_0x3cca87){_0x3cca87[_0x146d('0x25')]=!0x1;const _0x5ca0e5=this['getSidebarItemView'](_0x3cca87);_0x5ca0e5&&_0xfd01ea&&(_0x5ca0e5[_0x146d('0x13')]=!0x1);}if(_0x68ae86){const _0x4835cd=this[_0x146d('0x11')](_0x68ae86);_0x4835cd&&(_0x68ae86[_0x146d('0x25')]=!0x0,_0xfd01ea&&(_0x4835cd[_0x146d('0x13')]=!0x0,_0x4835cd[_0x146d('0x21')]+=0x1),this[_0x146d('0x43')](_0x4835cd));}}['_detachFromContainer'](_0x2f0b52){this[_0x146d('0xa')](),this[_0x146d('0x36')][_0x146d('0x12')][_0x146d('0x40')]();for(const _0x3f2ced of _0x2f0b52)this[_0x146d('0x2')](_0x3f2ced);this[_0x146d('0x36')][_0x146d('0x20')]['clear'](),this[_0x146d('0x36')][_0x146d('0x9')]='',this[_0x146d('0x15')]=null;}['addAnnotation'](_0x32ee34,_0xe00f6e){_0xe00f6e||(_0xe00f6e=_0x32ee34[_0x146d('0x36')]);const _0x19564b=new _0x238755(this[_0x146d('0x1b')][_0x146d('0x41')]);this[_0x146d('0x26')]['set'](_0x19564b,_0x32ee34),this[_0x146d('0x34')][_0x146d('0x44')](_0x32ee34,_0x19564b),_0x19564b[_0x146d('0x33')][_0x146d('0x1c')](_0xe00f6e),this[_0x146d('0x38')](_0x32ee34['view'],_0x146d('0x17'),(_0x1ab4b8,_0x1b2b5e,_0x4fc90c)=>{const _0x5d3c35=this[_0x146d('0x3e')](_0x32ee34,_0x4fc90c);_0x19564b[_0x146d('0x3f')]!=_0x5d3c35&&(_0x19564b[_0x146d('0x3f')]=_0x5d3c35,this[_0x146d('0x3')](_0x19564b,_0x5d3c35));}),this[_0x146d('0x38')](_0x19564b,'change:top',()=>{this[_0x146d('0x3b')](_0x19564b,'top');}),this['listenTo'](_0x19564b,_0x146d('0x32'),()=>{this[_0x146d('0x3b')](_0x19564b,'bottom');}),this['_alignToTargetRect'](_0x19564b);const _0x1e7ee3=this[_0x146d('0x14')](_0x19564b);if(_0x1e7ee3)this[_0x146d('0x6')](_0x1e7ee3,_0x19564b)||this['_alignToTargetRect'](_0x19564b);else this[_0x146d('0x43')](_0x19564b);return this[_0x146d('0x37')](),this[_0x146d('0x36')][_0x146d('0x20')]['add'](_0x19564b),_0x19564b;}[_0x146d('0x1e')](_0x42a3c5){if(!_0x42a3c5[_0x146d('0x33')][_0x146d('0x18')])return;const _0x3150d9=this[_0x146d('0x14')](_0x42a3c5);if(!_0x3150d9)return;const _0x2eaf8b=this['_sidebarItemViewToAnnotation'][_0x146d('0x23')](_0x3150d9),_0x3a9c94=this[_0x146d('0x35')];_0x3a9c94&&_0x3a9c94===_0x2eaf8b?this['_alignAfterItem'](_0x3150d9,_0x42a3c5):this[_0x146d('0x24')](_0x42a3c5,_0x3150d9);}[_0x146d('0x2c')](_0x3fa1f6){if(!_0x3fa1f6[_0x146d('0x33')]['length'])return;const _0x30db27=this['_getItemAfter'](_0x3fa1f6);if(!_0x30db27)return;const _0x14db2f=this[_0x146d('0x26')]['get'](_0x30db27),_0x45a067=this['context'][_0x146d('0x19')][_0x146d('0x23')]('sidebar.preventScrollOutOfView'),_0x54dfa1=this['_activeAnnotation'];_0x54dfa1&&_0x54dfa1===_0x14db2f&&_0x45a067?(this[_0x146d('0x24')](_0x30db27,_0x3fa1f6),this[_0x146d('0x6')](_0x3fa1f6,_0x30db27)):_0x54dfa1&&_0x54dfa1===_0x14db2f?this[_0x146d('0x24')](_0x30db27,_0x3fa1f6):this[_0x146d('0x6')](_0x3fa1f6,_0x30db27);}['_recalculate'](_0x5e2ef6,_0x182e54){0x0===this[_0x146d('0x2d')][_0x146d('0x18')]&&setTimeout(()=>{for(const {sidebarItemView:_0x24e96f,changedProp:_0x29c2ef}of this[_0x146d('0x2d')])_0x146d('0x21')===_0x29c2ef?this['_alignForTopChange'](_0x24e96f):this['_alignForBottomChange'](_0x24e96f);this[_0x146d('0x2d')]=[];},0xa),this[_0x146d('0x2d')][_0x146d('0x27')]({'sidebarItemView':_0x5e2ef6,'changedProp':_0x182e54});}['getSidebarItemView'](_0x2ce442){return this['_annotationToSidebarItemView'][_0x146d('0x23')](_0x2ce442);}['destroy'](){this['view'][_0x146d('0x0')]();}[_0x146d('0x2')](_0x36edb1){const _0x2857c5=this[_0x146d('0x11')](_0x36edb1);this['stopListening'](_0x2857c5),this['stopListening'](_0x36edb1[_0x146d('0x36')]),_0x2857c5[_0x146d('0x0')](),this['_annotationToSidebarItemView'][_0x146d('0x4')](_0x36edb1),this['_sidebarItemViewToAnnotation'][_0x146d('0x4')](_0x2857c5);}[_0x146d('0x1f')](){const _0x1b9f3c=new _0x25539f(this[_0x146d('0x1b')][_0x146d('0x41')]);return _0x1b9f3c[_0x146d('0xe')](),this['on'](_0x146d('0x22'),(_0x30dc67,_0x2410fc,_0x58af5a,_0x436b2d)=>{_0x436b2d&&_0x1b9f3c['unbind'](_0x146d('0x8')),_0x58af5a?_0x1b9f3c[_0x146d('0x39')](_0x146d('0x8'))['to'](_0x58af5a,_0x146d('0x28')):_0x1b9f3c['minHeight']=null;}),_0x1b9f3c;}[_0x146d('0x37')](){this[_0x146d('0x15')]=this[_0x146d('0x11')](this[_0x146d('0x2b')][_0x146d('0x3a')]);}['_getItemBefore'](_0x135a1d){const _0x59553f=this[_0x146d('0x26')][_0x146d('0x23')](_0x135a1d),_0x12cf73=this[_0x146d('0x2b')][_0x146d('0x23')](this[_0x146d('0x2b')][_0x146d('0xf')](_0x59553f)-0x1);return _0x12cf73&&this['getSidebarItemView'](_0x12cf73);}['_getItemAfter'](_0xf0041e){const _0x5391d0=this[_0x146d('0x26')][_0x146d('0x23')](_0xf0041e),_0x1ebad6=this[_0x146d('0x2b')][_0x146d('0x23')](this[_0x146d('0x2b')][_0x146d('0xf')](_0x5391d0)+0x1);return _0x1ebad6&&this[_0x146d('0x11')](_0x1ebad6);}[_0x146d('0x24')](_0x3f42ef,_0x829fc6){_0x3f42ef[_0x146d('0x16')]();const _0x5ef425=F(_0x829fc6[_0x146d('0x28')]+this['_spaceBetweenItems'],_0x3f42ef[_0x146d('0x21')]);return!!_0x5ef425&&(this[_0x146d('0x3')](_0x829fc6,_0x829fc6[_0x146d('0x21')]-_0x5ef425),!0x0);}['_alignAfterItem'](_0x479734,_0x104e51){_0x479734['updateHeight']();const _0x2f3720=F(_0x479734[_0x146d('0x28')]+this[_0x146d('0x29')],_0x104e51['top']);return!!_0x2f3720&&(this[_0x146d('0x3')](_0x104e51,_0x104e51[_0x146d('0x21')]+_0x2f3720,!0x1),!0x0);}[_0x146d('0x43')](_0x300360){const _0x51bd7c=this['_sidebarItemViewToAnnotation'][_0x146d('0x23')](_0x300360);if(!_0x51bd7c||!_0x51bd7c[_0x146d('0x3c')])return;const _0x51000a=this[_0x146d('0x3e')](_0x51bd7c,_0x51bd7c[_0x146d('0x31')]);this[_0x146d('0x3')](_0x300360,_0x51000a);}['_getTargetTop'](_0x677795,_0x25784a){if(null===_0x25784a)return 0x0;if(_0x677795[_0x146d('0x3c')]instanceof _0x4ed153)return _0x25784a['top'];{const _0xb984f3=new _0x4ed153(this[_0x146d('0x36')][_0x146d('0x12')])['top'];return _0x25784a[_0x146d('0x21')]-_0xb984f3;}}[_0x146d('0x3')](_0x1cd37b,_0x2a40c3,_0x514bbc=this['context'][_0x146d('0x19')][_0x146d('0x23')](_0x146d('0xb'))){_0x514bbc&&(_0x2a40c3=Math['max'](_0x2a40c3,this[_0x146d('0x1d')](_0x1cd37b))),_0x1cd37b[_0x146d('0x21')]=_0x2a40c3;}['_getMaxAvailableTop'](_0x4d3588){let _0x4e0b81=this['_getItemBefore'](_0x4d3588),_0x6ef36e=0x0;for(;_0x4e0b81;)_0x4e0b81[_0x146d('0x16')](),_0x6ef36e+=this[_0x146d('0x29')]+_0x4e0b81[_0x146d('0x10')],_0x4e0b81=this[_0x146d('0x14')](_0x4e0b81);return _0x6ef36e;}}function F(_0x32e4eb,_0x12a842){return Math[_0x146d('0xd')](_0x32e4eb-_0x12a842,0x0);}function p(_0x2ccf4f){return null!==_0x2ccf4f&&_0x146d('0x30')==typeof _0x2ccf4f&&0x1===_0x2ccf4f[_0x146d('0x42')];}
23
+ const _0x23f9=['_getTargetTop','delete','_alignForTopChange','_alignAfterItem','_attachToContainer','appendChild','_targetTop','max','top','get','refresh','change:bottom','_getItemAfter','init','sidebar-setcontainer-invalid-element','_alignBeforeItem','content','destroy','getSidebarItemView','rearrange','unbind','_alignToTargetRect','minHeight','_lastItem','define','length','element','sidebar-attachtocontainer-missing-container','setContainer','bind','nodeType','isActive','view','listenTo','_activeAnnotation','_recalculate','sidebar.preventScrollOutOfView','_getMaxAvailableTop','remove','_updateLastItem','object','_destroySidebarItemView','change:targetRect','_spaceBetweenItems','_alignForBottomChange','Sidebar','_setItemTop','add','getIndex','context','set','container','change:_lastItem','addAnnotation','last','change:top','render','_detachFromContainer','updateHeight','_createSidebarView','_getItemBefore','stopListening','_sidebarItemViewToAnnotation','list','targetRect','_annotations','_annotationToSidebarItemView','target','_recalculateBuffer','bottom','locale','clear','isAnimationDisabled','config'];(function(_0x35e5b6,_0x23f9f7){const _0x102d30=function(_0x5cac3f){while(--_0x5cac3f){_0x35e5b6['push'](_0x35e5b6['shift']());}};_0x102d30(++_0x23f9f7);}(_0x23f9,0x146));const _0x102d=function(_0x35e5b6,_0x23f9f7){_0x35e5b6=_0x35e5b6-0x0;let _0x102d30=_0x23f9[_0x35e5b6];return _0x102d30;};import{ContextPlugin as _0x14445a}from'ckeditor5/src/core';import{Rect as _0x1b1f6f,CKEditorError as _0x5cf2db}from'ckeditor5/src/utils';import _0x240aa0 from'./view/sidebarview';import _0x5d4168 from'./view/sidebaritemview';export default class z extends _0x14445a{static get['pluginName'](){return _0x102d('0xf');}constructor(_0x5e0158){super(_0x5e0158),this[_0x102d('0x14')]('_lastItem',void 0x0),this[_0x102d('0x2')]=this[_0x102d('0x1d')](),this[_0x102d('0x14')]('container',null),this[_0x102d('0xd')]=0x19,this[_0x102d('0x20')]=new Map(),this[_0x102d('0x24')]=new Map(),this[_0x102d('0x13')][_0x102d('0x2b')][_0x102d('0x44')](_0x102d('0x6'),!0x1),this[_0x102d('0x23')]=null,this['_activeAnnotation']=null,this[_0x102d('0x26')]=[];}[_0x102d('0x39')](){const _0x139444=this[_0x102d('0x13')]['config']['get']('sidebar.container');_0x139444&&this[_0x102d('0x48')](_0x139444);}[_0x102d('0x48')](_0x34d6f4){if(!y(_0x34d6f4))throw new _0x5cf2db(_0x102d('0x3a'));this[_0x102d('0x15')]=_0x34d6f4;}[_0x102d('0x30')]({viewClass:_0x3dac17='',spaceBetweenItems:_0x26ccfc=0x19}={}){if(!y(this['container']))throw new _0x5cf2db(_0x102d('0x47'),this);this[_0x102d('0x15')][_0x102d('0x31')](this['view'][_0x102d('0x46')]),this[_0x102d('0x2')]['class']=_0x3dac17,this[_0x102d('0xd')]=_0x26ccfc;}[_0x102d('0x3f')]({removedAnnotation:_0x5e847d,previousAnnotation:_0x5e02b4,nextAnnotation:_0x55c417}){const _0xc117f=this['getSidebarItemView'](_0x5e847d);this['view'][_0x102d('0x21')][_0x102d('0x8')](_0xc117f),this[_0x102d('0xb')](_0x5e847d),_0x5e02b4&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x5e02b4)),_0x55c417&&this[_0x102d('0x41')](this['getSidebarItemView'](_0x55c417)),this['_updateLastItem']();}[_0x102d('0x36')]({blurredAnnotation:_0x41397e,activatedAnnotation:_0x56386a,disableAnimationOnActivatedAnnotation:_0x2d1666}){if(this[_0x102d('0x4')]=_0x56386a,_0x41397e){_0x41397e['isActive']=!0x1;const _0x5d0fe5=this[_0x102d('0x3e')](_0x41397e);_0x5d0fe5&&_0x2d1666&&(_0x5d0fe5[_0x102d('0x2a')]=!0x1);}if(_0x56386a){const _0x9b5666=this[_0x102d('0x3e')](_0x56386a);_0x9b5666&&(_0x56386a[_0x102d('0x1')]=!0x0,_0x2d1666&&(_0x9b5666['isAnimationDisabled']=!0x0,_0x9b5666[_0x102d('0x34')]+=0x1),this[_0x102d('0x41')](_0x9b5666));}}[_0x102d('0x1b')](_0x2b41e5){if(this['stopListening'](),this[_0x102d('0x2')][_0x102d('0x46')][_0x102d('0x8')](),_0x2b41e5)for(const _0x428825 of _0x2b41e5)this[_0x102d('0xb')](_0x428825);this[_0x102d('0x2')][_0x102d('0x21')][_0x102d('0x29')](),this[_0x102d('0x2')]['class']='',this['_lastItem']=null;}[_0x102d('0x17')](_0xb4d019,_0x4d73e2){_0x4d73e2||(_0x4d73e2=_0xb4d019[_0x102d('0x2')]);const _0x34f1c3=new _0x5d4168(this[_0x102d('0x13')][_0x102d('0x28')]);this[_0x102d('0x20')]['set'](_0x34f1c3,_0xb4d019),this[_0x102d('0x24')]['set'](_0xb4d019,_0x34f1c3),_0x34f1c3[_0x102d('0x3c')][_0x102d('0x11')](_0x4d73e2),this[_0x102d('0x3')](_0xb4d019[_0x102d('0x2')],_0x102d('0xc'),(_0xf01d3c,_0x17667e,_0x25b043)=>{const _0x3b8e9a=this[_0x102d('0x2c')](_0xb4d019,_0x25b043);_0x34f1c3[_0x102d('0x32')]!=_0x3b8e9a&&(_0x34f1c3[_0x102d('0x32')]=_0x3b8e9a,this[_0x102d('0x10')](_0x34f1c3,_0x3b8e9a));}),this[_0x102d('0x3')](_0x34f1c3,_0x102d('0x19'),()=>{this[_0x102d('0x5')](_0x34f1c3,_0x102d('0x34'));}),this[_0x102d('0x3')](_0x34f1c3,_0x102d('0x37'),()=>{this['_recalculate'](_0x34f1c3,'bottom');}),this['_alignToTargetRect'](_0x34f1c3);const _0x346eb5=this[_0x102d('0x1e')](_0x34f1c3);if(_0x346eb5)this[_0x102d('0x2f')](_0x346eb5,_0x34f1c3)||this[_0x102d('0x41')](_0x34f1c3);else this[_0x102d('0x41')](_0x34f1c3);return this[_0x102d('0x9')](),this[_0x102d('0x2')][_0x102d('0x21')][_0x102d('0x11')](_0x34f1c3),_0x34f1c3;}['_alignForTopChange'](_0x432592){if(!_0x432592[_0x102d('0x3c')][_0x102d('0x45')])return;const _0x33e410=this[_0x102d('0x1e')](_0x432592);if(!_0x33e410)return;const _0x304884=this[_0x102d('0x20')]['get'](_0x33e410),_0x275f7f=this[_0x102d('0x4')];_0x275f7f&&_0x275f7f===_0x304884?this['_alignAfterItem'](_0x33e410,_0x432592):this[_0x102d('0x3b')](_0x432592,_0x33e410);}[_0x102d('0xe')](_0x18c74a){if(!_0x18c74a[_0x102d('0x3c')][_0x102d('0x45')])return;const _0x2b1384=this[_0x102d('0x38')](_0x18c74a);if(!_0x2b1384)return;const _0x7f0c03=this[_0x102d('0x20')][_0x102d('0x35')](_0x2b1384),_0x1812ea=this[_0x102d('0x13')][_0x102d('0x2b')]['get'](_0x102d('0x6')),_0x534886=this[_0x102d('0x4')];_0x534886&&_0x534886===_0x7f0c03&&_0x1812ea?(this[_0x102d('0x3b')](_0x2b1384,_0x18c74a),this[_0x102d('0x2f')](_0x18c74a,_0x2b1384)):_0x534886&&_0x534886===_0x7f0c03?this['_alignBeforeItem'](_0x2b1384,_0x18c74a):this[_0x102d('0x2f')](_0x18c74a,_0x2b1384);}[_0x102d('0x5')](_0x3b6a7a,_0x3f34de){0x0===this[_0x102d('0x26')]['length']&&setTimeout(()=>{for(const {sidebarItemView:_0x5660aa,changedProp:_0x35b2d5}of this[_0x102d('0x26')])_0x102d('0x34')===_0x35b2d5?this[_0x102d('0x2e')](_0x5660aa):this[_0x102d('0xe')](_0x5660aa);this['_recalculateBuffer']=[];},0xa),this[_0x102d('0x26')]['push']({'sidebarItemView':_0x3b6a7a,'changedProp':_0x3f34de});}[_0x102d('0x3e')](_0x5446f4){return this['_annotationToSidebarItemView']['get'](_0x5446f4);}[_0x102d('0x3d')](){this[_0x102d('0x2')][_0x102d('0x3d')]();}[_0x102d('0xb')](_0x47b04b){const _0x5c33df=this[_0x102d('0x3e')](_0x47b04b);this[_0x102d('0x1f')](_0x5c33df),this[_0x102d('0x1f')](_0x47b04b[_0x102d('0x2')]),_0x5c33df[_0x102d('0x3d')](),this['_annotationToSidebarItemView']['delete'](_0x47b04b),this[_0x102d('0x20')][_0x102d('0x2d')](_0x5c33df);}['_createSidebarView'](){const _0x5be744=new _0x240aa0(this[_0x102d('0x13')][_0x102d('0x28')]);return _0x5be744[_0x102d('0x1a')](),this['on'](_0x102d('0x16'),(_0x12c3bf,_0x3aaaf0,_0x5d00bb,_0x458b45)=>{_0x458b45&&_0x5be744[_0x102d('0x40')]('minHeight'),_0x5d00bb?_0x5be744[_0x102d('0x49')]('minHeight')['to'](_0x5d00bb,'bottom'):_0x5be744[_0x102d('0x42')]=null;}),_0x5be744;}[_0x102d('0x9')](){var _0x229810;this[_0x102d('0x43')]=(null===(_0x229810=this[_0x102d('0x23')])||void 0x0===_0x229810?void 0x0:_0x229810[_0x102d('0x18')])?this['getSidebarItemView'](this['_annotations'][_0x102d('0x18')]):null;}[_0x102d('0x1e')](_0x2454e3){var _0x2407d2;const _0xb6aa0=this[_0x102d('0x20')]['get'](_0x2454e3),_0x221f50=_0xb6aa0&&(null===(_0x2407d2=this[_0x102d('0x23')])||void 0x0===_0x2407d2?void 0x0:_0x2407d2['get'](this[_0x102d('0x23')][_0x102d('0x12')](_0xb6aa0)-0x1));return _0x221f50&&this[_0x102d('0x3e')](_0x221f50)||null;}['_getItemAfter'](_0xd939e5){var _0x221341;const _0x305337=this[_0x102d('0x20')]['get'](_0xd939e5),_0x1c55d3=_0x305337&&(null===(_0x221341=this[_0x102d('0x23')])||void 0x0===_0x221341?void 0x0:_0x221341['get'](this[_0x102d('0x23')]['getIndex'](_0x305337)+0x1));return _0x1c55d3&&this[_0x102d('0x3e')](_0x1c55d3)||null;}['_alignBeforeItem'](_0x4be619,_0x2b89c2){_0x4be619['updateHeight']();const _0x314b75=H(_0x2b89c2[_0x102d('0x27')]+this[_0x102d('0xd')],_0x4be619[_0x102d('0x34')]);return!!_0x314b75&&(this[_0x102d('0x10')](_0x2b89c2,_0x2b89c2[_0x102d('0x34')]-_0x314b75),!0x0);}['_alignAfterItem'](_0x3f9fb9,_0x3de95e){_0x3f9fb9['updateHeight']();const _0x5438d0=H(_0x3f9fb9[_0x102d('0x27')]+this['_spaceBetweenItems'],_0x3de95e['top']);return!!_0x5438d0&&(this['_setItemTop'](_0x3de95e,_0x3de95e[_0x102d('0x34')]+_0x5438d0,!0x1),!0x0);}[_0x102d('0x41')](_0x567ca0){const _0x4346a6=this[_0x102d('0x20')][_0x102d('0x35')](_0x567ca0);if(!_0x4346a6||!_0x4346a6['target']||!_0x4346a6[_0x102d('0x22')])return;const _0x469431=this[_0x102d('0x2c')](_0x4346a6,_0x4346a6[_0x102d('0x22')]);this['_setItemTop'](_0x567ca0,_0x469431);}[_0x102d('0x2c')](_0x1416a8,_0xccdf3a){if(null===_0xccdf3a)return 0x0;if(_0x1416a8[_0x102d('0x25')]instanceof _0x1b1f6f)return _0xccdf3a[_0x102d('0x34')];{const _0x344bc1=new _0x1b1f6f(this[_0x102d('0x2')]['element'])[_0x102d('0x34')];return _0xccdf3a[_0x102d('0x34')]-_0x344bc1;}}[_0x102d('0x10')](_0xc5c6fb,_0xd3c72b,_0x4f0fbb=this[_0x102d('0x13')][_0x102d('0x2b')][_0x102d('0x35')]('sidebar.preventScrollOutOfView')){_0x4f0fbb&&(_0xd3c72b=Math[_0x102d('0x33')](_0xd3c72b,this[_0x102d('0x7')](_0xc5c6fb))),_0xc5c6fb['top']=_0xd3c72b;}[_0x102d('0x7')](_0x48fa40){let _0x109045=this[_0x102d('0x1e')](_0x48fa40),_0x2e3ece=0x0;for(;_0x109045;)_0x109045[_0x102d('0x1c')](),_0x2e3ece+=this[_0x102d('0xd')]+_0x109045['height'],_0x109045=this[_0x102d('0x1e')](_0x109045);return _0x2e3ece;}}function H(_0x3a08cf,_0x30f202){return Math[_0x102d('0x33')](_0x3a08cf-_0x30f202,0x0);}function y(_0x5e126d){return null!==_0x5e126d&&_0x102d('0xa')==typeof _0x5e126d&&0x1===_0x5e126d[_0x102d('0x0')];}
@@ -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 _0x351e=['ck-annotation-counter__badge--edit-mode','...','add','counterView','children','ck-annotation-counter__badge--','_badge','annotationType','icon','number','isDirty','extendTemplate','ck-annotation-counter','bind','set'];(function(_0x37a05f,_0x351ed2){const _0x5d35b3=function(_0x2a9091){while(--_0x2a9091){_0x37a05f['push'](_0x37a05f['shift']());}};_0x5d35b3(++_0x351ed2);}(_0x351e,0x14d));const _0x5d35=function(_0x37a05f,_0x351ed2){_0x37a05f=_0x37a05f-0x0;let _0x5d35b3=_0x351e[_0x37a05f];return _0x5d35b3;};import{ButtonView as _0x4f288f,View as _0x1a58b2}from'ckeditor5/src/ui';import _0x2cb0a1 from'../../../theme/icons/add-comment.svg';export default class z extends _0x4f288f{constructor(_0x3b3cfe){super(_0x3b3cfe);const _0x4f8efa=this['bindTemplate'];this[_0x5d35('0xb')](_0x5d35('0x7'),!0x1),this['set'](_0x5d35('0x6'),0x0),this[_0x5d35('0xa')](_0x5d35('0x3'))['to'](this,_0x5d35('0x7'),this,_0x5d35('0x6'),(_0x46cf07,_0x1b5039)=>_0x46cf07?_0x5d35('0xd'):_0x1b5039),this[_0x5d35('0xb')](_0x5d35('0x4'),''),this[_0x5d35('0x5')]=_0x2cb0a1,this[_0x5d35('0x8')]({'attributes':{'class':[_0x5d35('0x9')]}}),this[_0x5d35('0x0')]=new _0x1a58b2(),this[_0x5d35('0x0')]['setTemplate']({'tag':'span','attributes':{'class':['ck-annotation-counter__badge',_0x4f8efa['to'](_0x5d35('0x4'),_0x56d804=>_0x5d35('0x2')+_0x56d804),_0x4f8efa['if'](_0x5d35('0x7'),_0x5d35('0xc'))]},'children':[{'text':_0x4f8efa['to']('_badge')}]}),this[_0x5d35('0x1')][_0x5d35('0xe')](this[_0x5d35('0x0')]);}}
23
+ const _0x2df1=['counterView','bind','span','set','add','ck-annotation-counter__badge--edit-mode','_badge','setTemplate','...','number','toString','isDirty','ck-annotation-counter__badge','annotationType','children'];(function(_0x4a37ae,_0x2df1bf){const _0x460c37=function(_0x56cf1f){while(--_0x56cf1f){_0x4a37ae['push'](_0x4a37ae['shift']());}};_0x460c37(++_0x2df1bf);}(_0x2df1,0x19c));const _0x460c=function(_0x4a37ae,_0x2df1bf){_0x4a37ae=_0x4a37ae-0x0;let _0x460c37=_0x2df1[_0x4a37ae];return _0x460c37;};import{ButtonView as _0x244a67,View as _0x3f56f5}from'ckeditor5/src/ui';import _0x1307b2 from'../../../theme/icons/add-comment.svg';export default class D extends _0x244a67{constructor(_0x24ea56){super(_0x24ea56);const _0x4a7e63=this['bindTemplate'];this[_0x460c('0xb')](_0x460c('0x4'),!0x1),this['set'](_0x460c('0x2'),0x0),this[_0x460c('0x9')](_0x460c('0xe'))['to'](this,_0x460c('0x4'),this,_0x460c('0x2'),(_0x1c72eb,_0x313e73)=>_0x1c72eb?_0x460c('0x1'):_0x313e73[_0x460c('0x3')]()),this['set'](_0x460c('0x6'),''),this['icon']=_0x1307b2,this['extendTemplate']({'attributes':{'class':['ck-annotation-counter']}}),this[_0x460c('0x8')]=new _0x3f56f5(),this['counterView'][_0x460c('0x0')]({'tag':_0x460c('0xa'),'attributes':{'class':[_0x460c('0x5'),_0x4a7e63['to']('annotationType',_0x2a95eb=>'ck-annotation-counter__badge--'+_0x2a95eb),_0x4a7e63['if'](_0x460c('0x4'),_0x460c('0xd'))]},'children':[{'text':_0x4a7e63['to'](_0x460c('0xe'))}]}),this[_0x460c('0x7')][_0x460c('0xc')](this['counterView']);}}