@ckeditor/ckeditor5-comments 38.0.1 → 38.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/build/comments.js +1 -1
  2. package/build/translations/en-au.js +1 -1
  3. package/build/translations/it.js +1 -1
  4. package/build/translations/lv.js +1 -1
  5. package/build/translations/pt-br.js +1 -1
  6. package/build/translations/sk.js +1 -1
  7. package/build/translations/sq.js +1 -0
  8. package/lang/translations/en-au.po +1 -1
  9. package/lang/translations/it.po +1 -1
  10. package/lang/translations/lv.po +1 -1
  11. package/lang/translations/pt-br.po +1 -1
  12. package/lang/translations/sk.po +1 -1
  13. package/lang/translations/sq.po +111 -0
  14. package/package.json +10 -8
  15. package/src/annotations/annotation.d.ts +86 -86
  16. package/src/annotations/annotation.js +1 -1
  17. package/src/annotations/annotationcollection.d.ts +94 -94
  18. package/src/annotations/annotationcollection.js +1 -1
  19. package/src/annotations/annotations.d.ts +150 -150
  20. package/src/annotations/annotations.js +1 -1
  21. package/src/annotations/annotationsuis.d.ts +228 -227
  22. package/src/annotations/annotationsuis.js +1 -1
  23. package/src/annotations/editorannotations.d.ts +63 -62
  24. package/src/annotations/editorannotations.js +1 -1
  25. package/src/annotations/inlineannotations.d.ts +86 -84
  26. package/src/annotations/inlineannotations.js +1 -1
  27. package/src/annotations/narrowsidebar.d.ts +81 -80
  28. package/src/annotations/narrowsidebar.js +1 -1
  29. package/src/annotations/sidebar.d.ts +96 -96
  30. package/src/annotations/sidebar.js +1 -1
  31. package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -25
  32. package/src/annotations/view/annotationcounterbuttonview.js +1 -1
  33. package/src/annotations/view/annotationview.d.ts +86 -86
  34. package/src/annotations/view/annotationview.js +1 -1
  35. package/src/annotations/view/sidebaritemview.d.ts +51 -51
  36. package/src/annotations/view/sidebaritemview.js +1 -1
  37. package/src/annotations/view/sidebarview.d.ts +28 -28
  38. package/src/annotations/view/sidebarview.js +1 -1
  39. package/src/annotations/widesidebar.d.ts +73 -72
  40. package/src/annotations/widesidebar.js +1 -1
  41. package/src/augmentation.d.ts +48 -48
  42. package/src/comments/addcommentthreadcommand.d.ts +31 -31
  43. package/src/comments/addcommentthreadcommand.js +1 -1
  44. package/src/comments/commentsarchive.d.ts +27 -25
  45. package/src/comments/commentsarchive.js +1 -1
  46. package/src/comments/commentsarchiveui.d.ts +34 -32
  47. package/src/comments/commentsarchiveui.js +1 -1
  48. package/src/comments/commentsediting.d.ts +75 -71
  49. package/src/comments/commentsediting.js +1 -1
  50. package/src/comments/commentsrepository.d.ts +1088 -1084
  51. package/src/comments/commentsrepository.js +1 -1
  52. package/src/comments/commentsui.d.ts +29 -25
  53. package/src/comments/commentsui.js +1 -1
  54. package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -13
  55. package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
  56. package/src/comments/integrations/importword.d.ts +17 -17
  57. package/src/comments/integrations/importword.js +1 -1
  58. package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -32
  59. package/src/comments/ui/commenteditor/commenteditor.js +1 -1
  60. package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -27
  61. package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
  62. package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -32
  63. package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
  64. package/src/comments/ui/commentthreadcontroller.d.ts +64 -64
  65. package/src/comments/ui/commentthreadcontroller.js +1 -1
  66. package/src/comments/ui/view/basecommentthreadview.d.ts +108 -108
  67. package/src/comments/ui/view/basecommentthreadview.js +1 -1
  68. package/src/comments/ui/view/basecommentview.d.ts +108 -108
  69. package/src/comments/ui/view/basecommentview.js +1 -1
  70. package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -9
  71. package/src/comments/ui/view/collapsedcommentsview.js +1 -1
  72. package/src/comments/ui/view/commentcontentview.d.ts +10 -10
  73. package/src/comments/ui/view/commentcontentview.js +1 -1
  74. package/src/comments/ui/view/commentinputview.d.ts +82 -82
  75. package/src/comments/ui/view/commentinputview.js +1 -1
  76. package/src/comments/ui/view/commentsarchiveview.d.ts +34 -34
  77. package/src/comments/ui/view/commentsarchiveview.js +1 -1
  78. package/src/comments/ui/view/commentslistview.d.ts +96 -96
  79. package/src/comments/ui/view/commentslistview.js +1 -1
  80. package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -46
  81. package/src/comments/ui/view/commentthreadheaderview.js +1 -1
  82. package/src/comments/ui/view/commentthreadinputview.d.ts +37 -37
  83. package/src/comments/ui/view/commentthreadinputview.js +1 -1
  84. package/src/comments/ui/view/commentthreadview.d.ts +113 -113
  85. package/src/comments/ui/view/commentthreadview.js +1 -1
  86. package/src/comments/ui/view/commentview.d.ts +239 -239
  87. package/src/comments/ui/view/commentview.js +1 -1
  88. package/src/comments.d.ts +31 -22
  89. package/src/comments.js +1 -1
  90. package/src/commentsonly.d.ts +29 -28
  91. package/src/commentsonly.js +1 -1
  92. package/src/config.d.ts +172 -172
  93. package/src/index.d.ts +21 -19
  94. package/src/index.js +1 -1
  95. package/src/utils/common-translations.d.ts +5 -5
  96. package/src/utils/common-translations.js +1 -1
  97. package/src/utils/createmutationobserver.d.ts +13 -13
  98. package/src/utils/createmutationobserver.js +1 -1
@@ -1,62 +1,63 @@
1
- /**
2
- * @module comments/annotations/editorannotations
3
- * @publicApi
4
- */
5
- import { Plugin, type PluginDependencies, type Editor } from 'ckeditor5/src/core';
6
- import type Annotation from './annotation';
7
- import type AnnotationCollection from './annotationcollection';
8
- /**
9
- * Integrates {@link module:comments/annotations/annotations~Annotations annotations} with the editor to provide proper behavior
10
- * for annotations created through the editor features.
11
- *
12
- * *Note: The API of this class might change in the near future.*
13
- *
14
- * Collects all types of the annotations created through the editor features and their markers and decides which annotation is currently
15
- * selected by the selection.
16
- *
17
- * Every editor plugin that adds an annotation should also
18
- * {@link module:comments/annotations/editorannotations~EditorAnnotations#addSourceCollector register a callback}
19
- * in which it will check whether given annotation should be marked as selected.
20
- */
21
- export default class EditorAnnotations extends Plugin {
22
- /**
23
- * @inheritDoc
24
- */
25
- static get requires(): PluginDependencies;
26
- /**
27
- * @inheritDoc
28
- */
29
- static get pluginName(): 'EditorAnnotations';
30
- /**
31
- * @inheritDoc
32
- */
33
- constructor(editor: Editor);
34
- /**
35
- * @inheritDoc
36
- */
37
- init(): void;
38
- /**
39
- * Registers given annotation as an editor annotation, that is an annotation that is linked with a target inside the editor content.
40
- */
41
- registerAnnotation(annotation: Annotation): void;
42
- hasDomSelection(): boolean;
43
- /**
44
- * Registers a callback that collects annotations and their markers.
45
- */
46
- addSourceCollector(callback: Function): void;
47
- /**
48
- * Finds all annotations selected by the editor selection and marks the most inner one as the active annotation.
49
- */
50
- refreshSelectedViews(): void;
51
- /**
52
- * Finds all annotations for selected markers in order from the most inner marker to the most outer marker.
53
- *
54
- * @param options.annotations The collection of annotations for given UI.
55
- * @param options.activeAnnotation The given UI active annotation.
56
- * It is used to determine the order if the selection contains the active annotation's marker.
57
- */
58
- getOrderedSelectedAnnotations({ activeAnnotation, annotations }: {
59
- activeAnnotation: Annotation | null;
60
- annotations: AnnotationCollection;
61
- }): Array<Annotation>;
62
- }
1
+ /**
2
+ * @module comments/annotations/editorannotations
3
+ * @publicApi
4
+ */
5
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
6
+ import Annotations from './annotations';
7
+ import type Annotation from './annotation';
8
+ import type AnnotationCollection from './annotationcollection';
9
+ /**
10
+ * Integrates {@link module:comments/annotations/annotations~Annotations annotations} with the editor to provide proper behavior
11
+ * for annotations created through the editor features.
12
+ *
13
+ * *Note: The API of this class might change in the near future.*
14
+ *
15
+ * Collects all types of the annotations created through the editor features and their markers and decides which annotation is currently
16
+ * selected by the selection.
17
+ *
18
+ * Every editor plugin that adds an annotation should also
19
+ * {@link module:comments/annotations/editorannotations~EditorAnnotations#addSourceCollector register a callback}
20
+ * in which it will check whether given annotation should be marked as selected.
21
+ */
22
+ export default class EditorAnnotations extends Plugin {
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ static get requires(): readonly [typeof Annotations];
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ static get pluginName(): "EditorAnnotations";
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ constructor(editor: Editor);
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ init(): void;
39
+ /**
40
+ * Registers given annotation as an editor annotation, that is an annotation that is linked with a target inside the editor content.
41
+ */
42
+ registerAnnotation(annotation: Annotation): void;
43
+ hasDomSelection(): boolean;
44
+ /**
45
+ * Registers a callback that collects annotations and their markers.
46
+ */
47
+ addSourceCollector(callback: Function): void;
48
+ /**
49
+ * Finds all annotations selected by the editor selection and marks the most inner one as the active annotation.
50
+ */
51
+ refreshSelectedViews(): void;
52
+ /**
53
+ * Finds all annotations for selected markers in order from the most inner marker to the most outer marker.
54
+ *
55
+ * @param options.annotations The collection of annotations for given UI.
56
+ * @param options.activeAnnotation The given UI active annotation.
57
+ * It is used to determine the order if the selection contains the active annotation's marker.
58
+ */
59
+ getOrderedSelectedAnnotations({ activeAnnotation, annotations }: {
60
+ activeAnnotation: Annotation | null;
61
+ annotations: AnnotationCollection;
62
+ }): Array<Annotation>;
63
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xd25d=['focusTracker','getOrderedSelectedAnnotations','hasDomSelection','addSourceCollector','_editorAnnotationsData','fire','editorannotations-invalid-source-callback','_dataCollectors','listenTo','function','collection','remove','editor','requires','_editorAnnotations','from','document','isCollapsed','add','set','get','map','isEqual','push','containsRange','directChange','editing','getByInnerView','change:range','blur','refreshSelectedViews','selection','view','EditorAnnotations','has','cancel','uiUpdate','update','registerAnnotation','annotation','init','model','delete','isReadOnly','innerView'];(function(_0x220a37,_0xd25dde){const _0x27ce18=function(_0x3110b3){while(--_0x3110b3){_0x220a37['push'](_0x220a37['shift']());}};_0x27ce18(++_0xd25dde);}(_0xd25d,0xf3));const _0x27ce=function(_0x220a37,_0xd25dde){_0x220a37=_0x220a37-0x0;let _0x27ce18=_0xd25d[_0x220a37];return _0x27ce18;};import{Plugin as _0x1c438b}from'ckeditor5/src/core';import{CKEditorError as _0x5aef46}from'ckeditor5/src/utils';import{debounce as _0x14ebaa}from'lodash-es';import _0x8ce792 from'./annotations';export default class k extends _0x1c438b{static get[_0x27ce('0x28')](){return[_0x8ce792];}static get['pluginName'](){return _0x27ce('0xf');}constructor(_0xe806f3){super(_0xe806f3),this[_0x27ce('0x22')]=new Set(),this['_editorAnnotations']=new Set();}[_0x27ce('0x16')](){const _0xa7a14b=this[_0x27ce('0x27')],_0x4c8815=_0xa7a14b[_0x27ce('0x17')][_0x27ce('0x2b')]['selection'],_0x478762=_0x14ebaa(()=>this[_0x27ce('0xc')](),0xa);_0x4c8815['on'](_0x27ce('0xa'),(_0x4f7278,_0x491ea9)=>{_0x491ea9[_0x27ce('0x7')]&&(_0x478762[_0x27ce('0x11')](),this[_0x27ce('0xc')]());}),this['listenTo'](_0xa7a14b['editing'][_0x27ce('0xe')][_0x27ce('0x2b')],'change:isFocused',(_0x3fe8c4,_0x52633a,_0xada5dc)=>{_0xada5dc&&_0x478762();}),this[_0x27ce('0x23')](_0xa7a14b['ui'][_0x27ce('0x1b')],'change:isFocused',(_0x5923d9,_0x3df636,_0x587203)=>{_0x587203||_0xa7a14b[_0x27ce('0x19')]||this[_0x27ce('0x20')](_0x27ce('0xb'),{'isAnnotationTracked':_0x4b91cc=>this['_editorAnnotationsData']['has'](_0x4b91cc[_0x27ce('0x1a')])});}),this[_0x27ce('0x23')](this[_0x27ce('0x27')]['ui'],_0x27ce('0x13'),()=>this[_0x27ce('0x20')](_0x27ce('0x12')));}[_0x27ce('0x14')](_0x58f683){if(this[_0x27ce('0x29')][_0x27ce('0x10')](_0x58f683[_0x27ce('0xe')]))return;this[_0x27ce('0x29')][_0x27ce('0x0')](_0x58f683['view']),this['editor']['ui'][_0x27ce('0x1b')][_0x27ce('0x0')](_0x58f683[_0x27ce('0xe')]['element']);const _0x2a356e=this[_0x27ce('0x27')]['plugins'][_0x27ce('0x2')](_0x8ce792);this[_0x27ce('0x23')](_0x2a356e[_0x27ce('0x25')],'remove',(_0x1bc321,_0x26f61f)=>{this[_0x27ce('0x27')]['ui']['focusTracker'][_0x27ce('0x26')](_0x26f61f[_0x27ce('0xe')]['element']),this['_editorAnnotations'][_0x27ce('0x18')](_0x26f61f['view']);});}[_0x27ce('0x1d')](){return this[_0x27ce('0x27')][_0x27ce('0x8')]['view'][_0x27ce('0x1d')];}[_0x27ce('0x1e')](_0xd47e10){if(_0x27ce('0x24')!=typeof _0xd47e10)throw new _0x5aef46(_0x27ce('0x21'));this[_0x27ce('0x22')][_0x27ce('0x0')](_0xd47e10);}[_0x27ce('0xc')](){this[_0x27ce('0x20')]('refresh');}[_0x27ce('0x1c')]({activeAnnotation:_0x4bf162,annotations:_0x1d96d1}){const _0x537327=[],_0x4305ce=this[_0x27ce('0x27')][_0x27ce('0x17')]['document'][_0x27ce('0xd')],_0x27c5b2=Array[_0x27ce('0x2a')](_0x4305ce['getRanges']());for(const [_0x2184ad,_0x103892]of this[_0x27ce('0x1f')]){const _0x1a2aaf=_0x412034(_0x103892),_0x1494bd=_0x1d96d1[_0x27ce('0x9')](_0x2184ad);_0x1a2aaf&&_0x1494bd&&_0x537327[_0x27ce('0x5')]({'annotation':_0x1494bd,'range':_0x1a2aaf});}function _0x412034(_0x53d257){for(const _0x35d430 of _0x53d257)for(const _0x1f5a10 of _0x27c5b2)if(_0x35d430[_0x27ce('0x6')](_0x1f5a10,!_0x4305ce[_0x27ce('0x2c')]))return _0x35d430;return null;}return _0x537327['sort']((_0x33c93b,_0x41a1de)=>{const _0x135d00=_0x33c93b['range'],_0x43e8ef=_0x41a1de['range'];if(!_0x135d00[_0x27ce('0x4')](_0x43e8ef)){if(_0x135d00[_0x27ce('0x6')](_0x43e8ef,!0x0))return 0x1;if(_0x43e8ef[_0x27ce('0x6')](_0x135d00,!0x0))return-0x1;}return _0x33c93b[_0x27ce('0x15')]==_0x4bf162?-0x1:_0x41a1de[_0x27ce('0x15')]==_0x4bf162?0x1:0x0;})[_0x27ce('0x3')](_0x10004e=>_0x10004e[_0x27ce('0x15')]);}get['_editorAnnotationsData'](){const _0x51f52f=new Map();for(const _0x2bf3a3 of Array[_0x27ce('0x2a')](this[_0x27ce('0x22')]))for(const [_0x10dd44,_0x558970]of _0x2bf3a3())_0x51f52f[_0x27ce('0x1')](_0x10dd44,_0x558970);return _0x51f52f;}}
23
+ const _0x32b7=['element','refresh','isCollapsed','hasDomSelection','set','pluginName','selection','getOrderedSelectedAnnotations','blur','focusTracker','refreshSelectedViews','collection','directChange','map','getRanges','annotation','innerView','_editorAnnotationsData','remove','listenTo','push','getByInnerView','cancel','has','document','add','change:range','isEqual','from','isReadOnly','_editorAnnotations','plugins','editor','function','editorannotations-invalid-source-callback','_dataCollectors','uiUpdate','fire','view','model','editing','range','get','init','update','addSourceCollector','change:isFocused','containsRange'];(function(_0x5d7009,_0x32b7b1){const _0x14d6cd=function(_0x10d720){while(--_0x10d720){_0x5d7009['push'](_0x5d7009['shift']());}};_0x14d6cd(++_0x32b7b1);}(_0x32b7,0x1ec));const _0x14d6=function(_0x5d7009,_0x32b7b1){_0x5d7009=_0x5d7009-0x0;let _0x14d6cd=_0x32b7[_0x5d7009];return _0x14d6cd;};import{Plugin as _0x2c1bd5}from'ckeditor5/src/core';import{CKEditorError as _0x26e1ba}from'ckeditor5/src/utils';import{debounce as _0x2dc048}from'lodash-es';import _0x54e1fb from'./annotations';export default class k extends _0x2c1bd5{static get['requires'](){return[_0x54e1fb];}static get[_0x14d6('0x29')](){return'EditorAnnotations';}constructor(_0x1538fe){super(_0x1538fe),this[_0x14d6('0x17')]=new Set(),this['_editorAnnotations']=new Set();}[_0x14d6('0x1f')](){const _0x153aca=this['editor'],_0x5c0b7e=_0x153aca['model'][_0x14d6('0xc')][_0x14d6('0x2a')],_0x544140=_0x2dc048(()=>this[_0x14d6('0x2e')](),0xa);_0x5c0b7e['on'](_0x14d6('0xe'),(_0x12bce5,_0x5e7778)=>{_0x5e7778[_0x14d6('0x0')]&&(_0x544140[_0x14d6('0xa')](),this['refreshSelectedViews']());}),this[_0x14d6('0x7')](_0x153aca[_0x14d6('0x1c')][_0x14d6('0x1a')][_0x14d6('0xc')],_0x14d6('0x22'),(_0x26913c,_0x2443f4,_0x1ebcf8)=>{_0x1ebcf8&&_0x544140();}),this[_0x14d6('0x7')](_0x153aca['ui']['focusTracker'],_0x14d6('0x22'),(_0x27e60b,_0x164451,_0x51b5aa)=>{_0x51b5aa||_0x153aca[_0x14d6('0x11')]||this[_0x14d6('0x19')](_0x14d6('0x2c'),{'isAnnotationTracked':_0x3b3cc8=>this['_editorAnnotationsData']['has'](_0x3b3cc8[_0x14d6('0x4')])});}),this[_0x14d6('0x7')](this['editor']['ui'],_0x14d6('0x20'),()=>this['fire'](_0x14d6('0x18')));}['registerAnnotation'](_0xd6f92d){if(this[_0x14d6('0x12')][_0x14d6('0xb')](_0xd6f92d[_0x14d6('0x1a')]))return;this[_0x14d6('0x12')][_0x14d6('0xd')](_0xd6f92d[_0x14d6('0x1a')]),this[_0x14d6('0x14')]['ui'][_0x14d6('0x2d')][_0x14d6('0xd')](_0xd6f92d[_0x14d6('0x1a')][_0x14d6('0x24')]);const _0x37379c=this[_0x14d6('0x14')][_0x14d6('0x13')][_0x14d6('0x1e')](_0x54e1fb);this[_0x14d6('0x7')](_0x37379c[_0x14d6('0x2f')],_0x14d6('0x6'),(_0x123158,_0x1371f9)=>{this[_0x14d6('0x14')]['ui'][_0x14d6('0x2d')][_0x14d6('0x6')](_0x1371f9[_0x14d6('0x1a')][_0x14d6('0x24')]),this[_0x14d6('0x12')]['delete'](_0x1371f9[_0x14d6('0x1a')]);});}[_0x14d6('0x27')](){return this[_0x14d6('0x14')][_0x14d6('0x1c')][_0x14d6('0x1a')][_0x14d6('0x27')];}[_0x14d6('0x21')](_0x385686){if(_0x14d6('0x15')!=typeof _0x385686)throw new _0x26e1ba(_0x14d6('0x16'));this['_dataCollectors'][_0x14d6('0xd')](_0x385686);}[_0x14d6('0x2e')](){this[_0x14d6('0x19')](_0x14d6('0x25'));}[_0x14d6('0x2b')]({activeAnnotation:_0x4115d3,annotations:_0x2adb37}){const _0x58cdf4=[],_0x4270dc=this[_0x14d6('0x14')][_0x14d6('0x1b')]['document'][_0x14d6('0x2a')],_0x5a3561=Array[_0x14d6('0x10')](_0x4270dc[_0x14d6('0x2')]());for(const [_0x1dc852,_0x1ca95d]of this['_editorAnnotationsData']){const _0x5693dd=_0x369163(_0x1ca95d),_0x584437=_0x2adb37[_0x14d6('0x9')](_0x1dc852);_0x5693dd&&_0x584437&&_0x58cdf4[_0x14d6('0x8')]({'annotation':_0x584437,'range':_0x5693dd});}function _0x369163(_0x149bd7){for(const _0x1876aa of _0x149bd7)for(const _0x22c1a7 of _0x5a3561)if(_0x1876aa[_0x14d6('0x23')](_0x22c1a7,!_0x4270dc[_0x14d6('0x26')]))return _0x1876aa;return null;}return _0x58cdf4['sort']((_0x391634,_0x3b1de9)=>{const _0x5405c9=_0x391634[_0x14d6('0x1d')],_0x590765=_0x3b1de9[_0x14d6('0x1d')];if(!_0x5405c9[_0x14d6('0xf')](_0x590765)){if(_0x5405c9[_0x14d6('0x23')](_0x590765,!0x0))return 0x1;if(_0x590765['containsRange'](_0x5405c9,!0x0))return-0x1;}return _0x391634[_0x14d6('0x3')]==_0x4115d3?-0x1:_0x3b1de9[_0x14d6('0x3')]==_0x4115d3?0x1:0x0;})[_0x14d6('0x1')](_0x31f601=>_0x31f601[_0x14d6('0x3')]);}get[_0x14d6('0x5')](){const _0x2ac5d4=new Map();for(const _0x129bee of Array[_0x14d6('0x10')](this[_0x14d6('0x17')]))for(const [_0xb5af54,_0x5e5885]of _0x129bee())_0x2ac5d4[_0x14d6('0x28')](_0xb5af54,_0x5e5885);return _0x2ac5d4;}}
@@ -1,84 +1,86 @@
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
- }
1
+ /**
2
+ * @module comments/annotations/inlineannotations
3
+ * @publicApi
4
+ */
5
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
6
+ import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
7
+ import EditorAnnotations from './editorannotations';
8
+ import { ContextualBalloon } from 'ckeditor5/src/ui';
9
+ import './../../theme/annotation-inline.css';
10
+ import type Annotation from './annotation';
11
+ import type AnnotationCollection from './annotationcollection';
12
+ /**
13
+ * The popup-style UI for displaying annotations next to editor target elements.
14
+ *
15
+ * It displays {@link module:comments/annotations/annotation~Annotation annotations} in the
16
+ * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon balloon} where the current
17
+ * {@link module:comments/annotations/inlineannotations~InlineAnnotations#activeAnnotation} is the displayed one.
18
+ *
19
+ * Note: this UI type works only with {@link module:core/editor/editor~Editor the Editor} and cannot be used in integrations where
20
+ * there is only {@link module:core/context~Context context} without any editor.
21
+ *
22
+ * This UI is intended for narrow screens.
23
+ *
24
+ * To activate this UI use one of the following:
25
+ *
26
+ * ```ts
27
+ * editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'inline' );
28
+ * editor.plugins.get( 'AnnotationsUIs' ).activate( 'inline', filter );
29
+ * ```
30
+ *
31
+ * See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
32
+ */
33
+ export default class InlineAnnotations extends Plugin implements AnnotationsUI<Plugin> {
34
+ /**
35
+ * An active annotation tracked by this UI.
36
+ *
37
+ * @observable
38
+ */
39
+ activeAnnotation: Annotation | null;
40
+ isAttached: boolean;
41
+ /**
42
+ * A collection of annotations controlled by this UI.
43
+ *
44
+ * This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
45
+ *
46
+ * It is set to `null` if `InlineAnnotations` is not
47
+ * {@link module:comments/annotations/inlineannotations~InlineAnnotations#attach attached}.
48
+ */
49
+ annotations: AnnotationCollection | null;
50
+ /**
51
+ * @inheritDoc
52
+ */
53
+ static get requires(): readonly [typeof EditorAnnotations, typeof ContextualBalloon, typeof AnnotationsUIs];
54
+ /**
55
+ * @inheritDoc
56
+ */
57
+ static get pluginName(): "InlineAnnotations";
58
+ /**
59
+ * @inheritDoc
60
+ */
61
+ constructor(editor: Editor);
62
+ /**
63
+ * @inheritDoc
64
+ */
65
+ init(): void;
66
+ /**
67
+ * @inheritDoc
68
+ */
69
+ afterInit(): void;
70
+ /**
71
+ * Sets the active annotation for this UI.
72
+ */
73
+ setActiveAnnotation(annotation: Annotation | null): void;
74
+ /**
75
+ * @inheritDoc
76
+ */
77
+ attach(annotations: AnnotationCollection): void;
78
+ /**
79
+ * @inheritDoc
80
+ */
81
+ detach(): void;
82
+ /**
83
+ * @inheritDoc
84
+ */
85
+ destroy(): void;
86
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2ae8=['push','isAttached','selection','getOrderedSelectedAnnotations','domConverter','annotations','change:height','_setSelectedAnnotations','destroy','hasView','_addedAnnotations','inlineannotations-not-allowed-with-context','_manuallyClosed','inlineannotations-detach-not-attached','_closeAnnotation','listenTo','_getBalloonTargetForAnnotation','switchTo','init','change:visibleView','hasActive','includes','view','register','collapse','activeAnnotation','_addAnnotationToBalloon','length','getClientRects','_balloon','InlineAnnotations','getBoundingClientRect','target','mousedown','isFocused','_selectedAnnotations','editing','visibleView','fromRect','showStack','plugins','has','stopListening','attach','getByView','Esc','addObserver','left','focusTracker','editor','width','get','map','keystrokes','change:isFocused','setActiveAnnotation','top','add','detach','delete','bottom','set','document','remove','from','_forceRefresh','blur','right','clear','_removeAnnotationFromBalloon','inline','update','focus','every','inlineannotations-attach-already-attached','requires','context'];(function(_0x42fd44,_0x2ae8c7){const _0x4b079c=function(_0x13b99a){while(--_0x13b99a){_0x42fd44['push'](_0x42fd44['shift']());}};_0x4b079c(++_0x2ae8c7);}(_0x2ae8,0x17d));const _0x4b07=function(_0x42fd44,_0x2ae8c7){_0x42fd44=_0x42fd44-0x0;let _0x4b079c=_0x2ae8[_0x42fd44];return _0x4b079c;};import{Plugin as _0x45b152}from'ckeditor5/src/core';import _0x2f5116 from'./annotationsuis';import _0x217cf6 from'./editorannotations';import{ContextualBalloon as _0x423811}from'ckeditor5/src/ui';import{MouseObserver as _0xac997c}from'ckeditor5/src/engine';import{CKEditorError as _0x1887cf,Rect as _0x1a1d0c}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x45b152{static get[_0x4b07('0x2')](){return[_0x217cf6,_0x423811,_0x2f5116];}static get['pluginName'](){return _0x4b07('0x22');}constructor(_0x59fb5e){super(_0x59fb5e),_0x59fb5e['editing']['view'][_0x4b07('0x32')](_0xac997c),this[_0x4b07('0x5')]=!0x1,this[_0x4b07('0x41')](_0x4b07('0x1d'),null),this[_0x4b07('0x9')]=null,this[_0x4b07('0x10')]=new Set(),this[_0x4b07('0x21')]=_0x59fb5e[_0x4b07('0x2c')][_0x4b07('0x37')](_0x423811),this[_0x4b07('0xe')]=new Set(),this[_0x4b07('0x27')]=[],this[_0x4b07('0x45')]=!0x1;}[_0x4b07('0x16')](){const _0x442b43=this[_0x4b07('0x35')]['plugins'][_0x4b07('0x37')](_0x2f5116);_0x442b43[_0x4b07('0x3')]===this[_0x4b07('0x35')]&&(_0x442b43[_0x4b07('0x1b')]('inline',this),this[_0x4b07('0x35')][_0x4b07('0x39')][_0x4b07('0x41')](_0x4b07('0x31'),(_0x2f700b,_0x2d1a69)=>{const _0x3292ce=this[_0x4b07('0x21')];if(this[_0x4b07('0x5')]&&_0x3292ce[_0x4b07('0x29')]){const _0x14b56d=this[_0x4b07('0x9')][_0x4b07('0x30')](_0x3292ce['visibleView']);_0x14b56d&&this[_0x4b07('0x12')](_0x14b56d),_0x2d1a69();}}));}['afterInit'](){const _0x172407=this[_0x4b07('0x35')]['plugins'][_0x4b07('0x37')](_0x2f5116);_0x172407[_0x4b07('0x3')]===this[_0x4b07('0x35')]&&(_0x172407[_0x4b07('0x18')]()||_0x172407[_0x4b07('0x15')](_0x4b07('0x4a')));}[_0x4b07('0x3b')](_0x80ccea){_0x80ccea!==this[_0x4b07('0x1d')]&&(this[_0x4b07('0x1d')]&&(this[_0x4b07('0x1d')]['isActive']=!0x1),_0x80ccea&&this[_0x4b07('0x35')]['ui'][_0x4b07('0x34')][_0x4b07('0x26')]&&(this['annotations']['has'](_0x80ccea)&&this[_0x4b07('0x1e')](_0x80ccea,!0x0),_0x80ccea['isActive']=!0x0),_0x80ccea||this['_setSelectedAnnotations']([]),this[_0x4b07('0x1d')]=_0x80ccea);}[_0x4b07('0x2f')](_0x1c93e5){this['annotations']=_0x1c93e5;const _0x3b8706=this['editor'][_0x4b07('0x2c')][_0x4b07('0x37')](_0x2f5116),_0x1f984c=this['_balloon'];if(this[_0x4b07('0x5')])throw new _0x1887cf(_0x4b07('0x1'),this);if(_0x3b8706[_0x4b07('0x3')]!==this[_0x4b07('0x35')])throw new _0x1887cf(_0x4b07('0xf'),this);const _0x346902=this[_0x4b07('0x35')][_0x4b07('0x2c')]['get'](_0x217cf6);this[_0x4b07('0x13')](_0x346902,'refresh',()=>{const _0x285c6b=_0x346902[_0x4b07('0x7')]({'annotations':this[_0x4b07('0x9')],'activeAnnotation':this['activeAnnotation']});var _0x1426fd,_0x3d1b80;!this[_0x4b07('0x45')]&&(_0x1426fd=_0x285c6b,_0x3d1b80=this[_0x4b07('0x27')],_0x1426fd[_0x4b07('0x1f')]===_0x3d1b80['length']&&_0x1426fd[_0x4b07('0x0')](_0x429291=>_0x3d1b80['includes'](_0x429291)))||(this['_forceRefresh']=!0x1,this['_setSelectedAnnotations'](_0x285c6b),this['setActiveAnnotation'](_0x285c6b[0x0]||null));}),this[_0x4b07('0x13')](_0x346902,_0x4b07('0x46'),(_0x42782b,{isAnnotationTracked:_0x3f6651})=>{this[_0x4b07('0x1d')]&&_0x3f6651(this[_0x4b07('0x1d')])&&(this[_0x4b07('0xb')]([]),this[_0x4b07('0x3b')](null));}),this['listenTo'](this[_0x4b07('0x35')]['ui'][_0x4b07('0x34')],_0x4b07('0x3a'),(_0x194063,_0x3a5f17,_0x95f79c)=>{_0x95f79c||this['setActiveAnnotation'](null);}),this[_0x4b07('0x13')](_0x1c93e5,_0x4b07('0x43'),(_0x2e4613,_0x3efc8d)=>{this['_removeAnnotationFromBalloon'](_0x3efc8d),_0x3efc8d===this[_0x4b07('0x1d')]&&this[_0x4b07('0x3b')](null);}),this['listenTo'](_0x1f984c,_0x4b07('0x17'),(_0x40d68b,_0x29d364,_0x3a920b,_0x4d2f7f)=>{_0x4d2f7f&&this[_0x4b07('0x2e')](_0x4d2f7f);const _0x1ccbc1=_0x1c93e5[_0x4b07('0x30')](_0x3a920b);_0x3a920b&&_0x1ccbc1&&(this[_0x4b07('0x13')](_0x3a920b,_0x4b07('0xa'),()=>{_0x1f984c['updatePosition']();}),this[_0x4b07('0x13')](_0x3a920b,_0x4b07('0x31'),()=>{this[_0x4b07('0x12')](_0x1ccbc1),this['editor']['editing']['view'][_0x4b07('0x4c')]();}),this[_0x4b07('0x1d')]!==_0x1ccbc1&&this['setActiveAnnotation'](_0x1ccbc1));}),this['listenTo'](this[_0x4b07('0x35')]['ui'],_0x4b07('0x4b'),()=>{_0x1f984c['visibleView']&&(_0x1c93e5[_0x4b07('0x30')](_0x1f984c['visibleView'])&&_0x1f984c['updatePosition']());}),this[_0x4b07('0x13')](this['editor'][_0x4b07('0x28')][_0x4b07('0x1a')][_0x4b07('0x42')],_0x4b07('0x25'),()=>{this[_0x4b07('0x45')]=!0x0,this[_0x4b07('0x10')][_0x4b07('0x48')]();}),this[_0x4b07('0x35')]['editing'][_0x4b07('0x1a')][_0x4b07('0x42')][_0x4b07('0x6')]['editableElement']&&this[_0x4b07('0x35')][_0x4b07('0x28')][_0x4b07('0x1a')][_0x4b07('0x4c')](),this[_0x4b07('0x5')]=!0x0;}[_0x4b07('0x3e')](){if(!this[_0x4b07('0x5')])throw new _0x1887cf(_0x4b07('0x11'),this);this[_0x4b07('0x3b')](null);for(const _0x4afe51 of this[_0x4b07('0xe')])this[_0x4b07('0x49')](_0x4afe51);this[_0x4b07('0x2e')](),this[_0x4b07('0x5')]=!0x1,this[_0x4b07('0x9')]=null;}[_0x4b07('0xc')](){this['isAttached']&&this[_0x4b07('0x3e')]();}[_0x4b07('0xb')](_0x36c107){for(const _0x286df8 of this[_0x4b07('0x27')])_0x36c107[_0x4b07('0x19')](_0x286df8)||this[_0x4b07('0x10')][_0x4b07('0x3f')](_0x286df8);for(const _0x36dec3 of this[_0x4b07('0x9')])_0x36c107['includes'](_0x36dec3)||this[_0x4b07('0x49')](_0x36dec3);if(this[_0x4b07('0x35')]['ui'][_0x4b07('0x34')]['isFocused'])for(const _0x5a35c4 of _0x36c107)this[_0x4b07('0x1e')](_0x5a35c4);this['_selectedAnnotations']=_0x36c107;}[_0x4b07('0x1e')](_0x627e6d,_0x5ae4a4=!0x1){this[_0x4b07('0x10')][_0x4b07('0x2d')](_0x627e6d)||(this[_0x4b07('0xe')][_0x4b07('0x2d')](_0x627e6d)||this[_0x4b07('0x21')][_0x4b07('0xd')](_0x627e6d['view'])||(this[_0x4b07('0xe')][_0x4b07('0x3d')](_0x627e6d),this[_0x4b07('0x21')][_0x4b07('0x3d')]({'stackId':_0x627e6d['view']['id'],'view':_0x627e6d[_0x4b07('0x1a')],'position':{'target':()=>this[_0x4b07('0x14')](_0x627e6d)}})),_0x5ae4a4&&this[_0x4b07('0x21')][_0x4b07('0x2b')](_0x627e6d[_0x4b07('0x1a')]['id']));}[_0x4b07('0x14')](_0x32fd2b){const _0x16fd2c=_0x32fd2b[_0x4b07('0x24')],_0x3beb40=this[_0x4b07('0x35')][_0x4b07('0x28')]['view'],_0x350260=_0x3beb40['document'][_0x4b07('0x6')]['getFirstRange'](),_0xaf4668=_0x3beb40[_0x4b07('0x8')]['viewRangeToDom'](_0x350260);if(_0xaf4668[_0x4b07('0x1c')](!0x0),_0x16fd2c){if(_0x16fd2c instanceof _0x1a1d0c)return _0x16fd2c;let _0x507af5=[];for(const _0x2ed322 of _0x16fd2c)_0x507af5[_0x4b07('0x4')](...(_0x4ea27e=_0x2ed322[_0x4b07('0x20')](),Array[_0x4b07('0x44')](_0x4ea27e)[_0x4b07('0x38')](DOMRect[_0x4b07('0x2a')])));_0x507af5=function(_0x1d8d43){const _0x25b934=[];let _0x164b67=_0x1d8d43[0x0];for(let _0x48db3b=0x1;_0x48db3b<_0x1d8d43[_0x4b07('0x1f')];_0x48db3b++)F(_0x164b67,_0x1d8d43[_0x48db3b])?_0x164b67[_0x4b07('0x36')]+=_0x1d8d43[_0x48db3b][_0x4b07('0x36')]:(_0x25b934[_0x4b07('0x4')](_0x164b67),_0x164b67=_0x1d8d43[_0x48db3b]);return _0x25b934[_0x4b07('0x4')](_0x164b67),_0x25b934;}(_0x507af5);const _0x3c8633=_0xaf4668[_0x4b07('0x23')]();return _0x507af5['find'](_0x1503bc=>_0x1503bc[_0x4b07('0x3c')]<=_0x3c8633[_0x4b07('0x3c')]&&_0x1503bc['bottom']>=_0x3c8633[_0x4b07('0x40')]&&_0x1503bc['left']<=_0x3c8633[_0x4b07('0x33')]&&_0x1503bc[_0x4b07('0x47')]>=_0x3c8633[_0x4b07('0x47')])||_0x507af5[0x0];}var _0x4ea27e;return _0x32fd2b['targetRect']||_0xaf4668;}['_removeAnnotationFromBalloon'](_0x3486a8){this['_addedAnnotations']['has'](_0x3486a8)&&this['_balloon'][_0x4b07('0xd')](_0x3486a8[_0x4b07('0x1a')])&&(this[_0x4b07('0xe')][_0x4b07('0x3f')](_0x3486a8),this['_balloon'][_0x4b07('0x43')](_0x3486a8['view']));}[_0x4b07('0x12')](_0xc91515){this[_0x4b07('0x10')][_0x4b07('0x3d')](_0xc91515),this[_0x4b07('0x49')](_0xc91515);}}function F(_0x55b3cf,_0x4db211){return _0x55b3cf['top']===_0x4db211['top']&&_0x55b3cf[_0x4b07('0x40')]===_0x4db211[_0x4b07('0x40')]&&_0x55b3cf[_0x4b07('0x47')]===_0x4db211[_0x4b07('0x33')];}
23
+ const _0x68ec=['targetRect','_addAnnotationToBalloon','Esc','viewRangeToDom','hasView','isAttached','editableElement','getClientRects','view','hasActive','switchTo','updatePosition','activeAnnotation','detach','change:height','delete','map','getOrderedSelectedAnnotations','selection','update','stopListening','get','has','annotations','remove','target','listenTo','setActiveAnnotation','pluginName','destroy','_getBalloonTargetForAnnotation','getFirstRange','width','every','_addedAnnotations','attach','fromRect','left','afterInit','push','_closeAnnotation','mousedown','getBoundingClientRect','_setSelectedAnnotations','includes','isFocused','keystrokes','inlineannotations-detach-not-attached','focus','inline','domConverter','document','find','_forceRefresh','from','getByView','_selectedAnnotations','length','plugins','_manuallyClosed','editor','isActive','right','showStack','top','editing','change:visibleView','requires','clear','refresh','register','inlineannotations-not-allowed-with-context','InlineAnnotations','add','addObserver','visibleView','set','_balloon','_removeAnnotationFromBalloon','bottom','focusTracker','context'];(function(_0x35f67e,_0x68ecb3){const _0x11dcd7=function(_0x4aa1b6){while(--_0x4aa1b6){_0x35f67e['push'](_0x35f67e['shift']());}};_0x11dcd7(++_0x68ecb3);}(_0x68ec,0x146));const _0x11dc=function(_0x35f67e,_0x68ecb3){_0x35f67e=_0x35f67e-0x0;let _0x11dcd7=_0x68ec[_0x35f67e];return _0x11dcd7;};import{Plugin as _0x5665cc}from'ckeditor5/src/core';import _0x2d0665 from'./annotationsuis';import _0x10931f from'./editorannotations';import{ContextualBalloon as _0x22bb93}from'ckeditor5/src/ui';import{MouseObserver as _0x4a0163}from'ckeditor5/src/engine';import{CKEditorError as _0x2606df,Rect as _0x559d6e}from'ckeditor5/src/utils';import'./../../theme/annotation-inline.css';export default class c extends _0x5665cc{static get[_0x11dc('0x45')](){return[_0x10931f,_0x22bb93,_0x2d0665];}static get[_0x11dc('0x1e')](){return _0x11dc('0x4a');}constructor(_0x3853b9){super(_0x3853b9),_0x3853b9[_0x11dc('0x43')][_0x11dc('0xa')][_0x11dc('0x4c')](_0x4a0163),this['isAttached']=!0x1,this[_0x11dc('0x4e')]('activeAnnotation',null),this[_0x11dc('0x19')]=null,this[_0x11dc('0x3d')]=new Set(),this[_0x11dc('0x4f')]=_0x3853b9[_0x11dc('0x3c')][_0x11dc('0x17')](_0x22bb93),this[_0x11dc('0x24')]=new Set(),this['_selectedAnnotations']=[],this[_0x11dc('0x37')]=!0x1;}['init'](){const _0x1030e4=this[_0x11dc('0x3e')][_0x11dc('0x3c')][_0x11dc('0x17')](_0x2d0665);_0x1030e4[_0x11dc('0x1')]===this[_0x11dc('0x3e')]&&(_0x1030e4[_0x11dc('0x48')](_0x11dc('0x33'),this),this['editor'][_0x11dc('0x30')][_0x11dc('0x4e')]('Esc',(_0x53a118,_0x5a3a8a)=>{const _0x511be4=this[_0x11dc('0x4f')];if(this[_0x11dc('0x7')]&&_0x511be4[_0x11dc('0x4d')]){const _0x2beca9=this[_0x11dc('0x19')][_0x11dc('0x39')](_0x511be4['visibleView']);_0x2beca9&&this[_0x11dc('0x2a')](_0x2beca9),_0x5a3a8a();}}));}[_0x11dc('0x28')](){const _0x1aa42d=this[_0x11dc('0x3e')][_0x11dc('0x3c')][_0x11dc('0x17')](_0x2d0665);_0x1aa42d[_0x11dc('0x1')]===this[_0x11dc('0x3e')]&&(_0x1aa42d[_0x11dc('0xb')]()||_0x1aa42d[_0x11dc('0xc')](_0x11dc('0x33')));}[_0x11dc('0x1d')](_0x569be5){_0x569be5!==this[_0x11dc('0xe')]&&(this[_0x11dc('0xe')]&&(this['activeAnnotation'][_0x11dc('0x3f')]=!0x1),_0x569be5&&this[_0x11dc('0x3e')]['ui'][_0x11dc('0x0')][_0x11dc('0x2f')]&&(this[_0x11dc('0x19')][_0x11dc('0x18')](_0x569be5)&&this[_0x11dc('0x3')](_0x569be5,!0x0),_0x569be5[_0x11dc('0x3f')]=!0x0),_0x569be5||this[_0x11dc('0x2d')]([]),this[_0x11dc('0xe')]=_0x569be5);}[_0x11dc('0x25')](_0x19146c){this[_0x11dc('0x19')]=_0x19146c;const _0x5e7ad6=this[_0x11dc('0x3e')][_0x11dc('0x3c')][_0x11dc('0x17')](_0x2d0665),_0x107406=this[_0x11dc('0x4f')];if(this['isAttached'])throw new _0x2606df('inlineannotations-attach-already-attached',this);if(_0x5e7ad6[_0x11dc('0x1')]!==this[_0x11dc('0x3e')])throw new _0x2606df(_0x11dc('0x49'),this);const _0x18cc90=this[_0x11dc('0x3e')][_0x11dc('0x3c')][_0x11dc('0x17')](_0x10931f);this[_0x11dc('0x1c')](_0x18cc90,_0x11dc('0x47'),()=>{const _0x758bc4=_0x18cc90[_0x11dc('0x13')]({'annotations':this[_0x11dc('0x19')],'activeAnnotation':this['activeAnnotation']});var _0x3e5322,_0x20dc6c;!this[_0x11dc('0x37')]&&(_0x3e5322=_0x758bc4,_0x20dc6c=this[_0x11dc('0x3a')],_0x3e5322['length']===_0x20dc6c[_0x11dc('0x3b')]&&_0x3e5322[_0x11dc('0x23')](_0x34ab17=>_0x20dc6c[_0x11dc('0x2e')](_0x34ab17)))||(this[_0x11dc('0x37')]=!0x1,this[_0x11dc('0x2d')](_0x758bc4),this['setActiveAnnotation'](_0x758bc4[0x0]||null));}),this[_0x11dc('0x1c')](_0x18cc90,'blur',(_0x4d9956,{isAnnotationTracked:_0x4aa1b8})=>{this[_0x11dc('0xe')]&&_0x4aa1b8(this[_0x11dc('0xe')])&&(this[_0x11dc('0x2d')]([]),this[_0x11dc('0x1d')](null));}),this['listenTo'](this[_0x11dc('0x3e')]['ui'][_0x11dc('0x0')],'change:isFocused',(_0x448002,_0x27c2b5,_0x4ce9f7)=>{_0x4ce9f7||this[_0x11dc('0x1d')](null);}),this[_0x11dc('0x1c')](_0x19146c,_0x11dc('0x1a'),(_0x7cc125,_0x2191b0)=>{this['_removeAnnotationFromBalloon'](_0x2191b0),_0x2191b0===this[_0x11dc('0xe')]&&this[_0x11dc('0x1d')](null);}),this[_0x11dc('0x1c')](_0x107406,_0x11dc('0x44'),(_0x5c3a5b,_0x6b34b2,_0x6e2403,_0x264d89)=>{_0x264d89&&this[_0x11dc('0x16')](_0x264d89);const _0x13af38=_0x19146c['getByView'](_0x6e2403);_0x6e2403&&_0x13af38&&(this['listenTo'](_0x6e2403,_0x11dc('0x10'),()=>{_0x107406['updatePosition']();}),this[_0x11dc('0x1c')](_0x6e2403,_0x11dc('0x4'),()=>{this[_0x11dc('0x2a')](_0x13af38),this[_0x11dc('0x3e')][_0x11dc('0x43')][_0x11dc('0xa')][_0x11dc('0x32')]();}),this[_0x11dc('0xe')]!==_0x13af38&&this[_0x11dc('0x1d')](_0x13af38));}),this[_0x11dc('0x1c')](this[_0x11dc('0x3e')]['ui'],_0x11dc('0x15'),()=>{_0x107406['visibleView']&&(_0x19146c[_0x11dc('0x39')](_0x107406[_0x11dc('0x4d')])&&_0x107406[_0x11dc('0xd')]());}),this[_0x11dc('0x1c')](this[_0x11dc('0x3e')]['editing'][_0x11dc('0xa')]['document'],_0x11dc('0x2b'),()=>{this[_0x11dc('0x37')]=!0x0,this[_0x11dc('0x3d')][_0x11dc('0x46')]();}),this[_0x11dc('0x3e')][_0x11dc('0x43')]['view'][_0x11dc('0x35')][_0x11dc('0x14')][_0x11dc('0x8')]&&this[_0x11dc('0x3e')][_0x11dc('0x43')][_0x11dc('0xa')][_0x11dc('0x32')](),this[_0x11dc('0x7')]=!0x0;}[_0x11dc('0xf')](){if(!this[_0x11dc('0x7')])throw new _0x2606df(_0x11dc('0x31'),this);this[_0x11dc('0x1d')](null);for(const _0xcfb3da of this[_0x11dc('0x24')])this[_0x11dc('0x50')](_0xcfb3da);this[_0x11dc('0x16')](),this[_0x11dc('0x7')]=!0x1,this['annotations']=null;}[_0x11dc('0x1f')](){this[_0x11dc('0x7')]&&this['detach']();}[_0x11dc('0x2d')](_0x4c139c){for(const _0xb8a520 of this[_0x11dc('0x3a')])_0x4c139c[_0x11dc('0x2e')](_0xb8a520)||this['_manuallyClosed']['delete'](_0xb8a520);for(const _0x3d870e of this[_0x11dc('0x19')])_0x4c139c[_0x11dc('0x2e')](_0x3d870e)||this[_0x11dc('0x50')](_0x3d870e);if(this[_0x11dc('0x3e')]['ui'][_0x11dc('0x0')][_0x11dc('0x2f')])for(const _0x16d9db of _0x4c139c)this['_addAnnotationToBalloon'](_0x16d9db);this[_0x11dc('0x3a')]=_0x4c139c;}[_0x11dc('0x3')](_0x316563,_0x126f15=!0x1){this[_0x11dc('0x3d')]['has'](_0x316563)||(this['_addedAnnotations'][_0x11dc('0x18')](_0x316563)||this[_0x11dc('0x4f')][_0x11dc('0x6')](_0x316563[_0x11dc('0xa')])||(this['_addedAnnotations'][_0x11dc('0x4b')](_0x316563),this[_0x11dc('0x4f')][_0x11dc('0x4b')]({'stackId':_0x316563[_0x11dc('0xa')]['id'],'view':_0x316563['view'],'position':{'target':()=>this[_0x11dc('0x20')](_0x316563)}})),_0x126f15&&this['_balloon'][_0x11dc('0x41')](_0x316563[_0x11dc('0xa')]['id']));}[_0x11dc('0x20')](_0x1a5c8d){const _0x40b303=_0x1a5c8d[_0x11dc('0x1b')],_0x157aff=this[_0x11dc('0x3e')][_0x11dc('0x43')][_0x11dc('0xa')],_0x5a8d07=_0x157aff[_0x11dc('0x35')][_0x11dc('0x14')][_0x11dc('0x21')](),_0x15f0c1=_0x157aff[_0x11dc('0x34')][_0x11dc('0x5')](_0x5a8d07);if(_0x15f0c1['collapse'](!0x0),_0x40b303){if(_0x40b303 instanceof _0x559d6e)return _0x40b303;let _0xb5c670=[];for(const _0x8fb271 of _0x40b303)_0xb5c670['push'](...(_0x34a59f=_0x8fb271[_0x11dc('0x9')](),Array[_0x11dc('0x38')](_0x34a59f)[_0x11dc('0x12')](DOMRect[_0x11dc('0x26')])));_0xb5c670=function(_0x878bf8){const _0x55834b=[];let _0x5c79e3=_0x878bf8[0x0];for(let _0xf46029=0x1;_0xf46029<_0x878bf8[_0x11dc('0x3b')];_0xf46029++)F(_0x5c79e3,_0x878bf8[_0xf46029])?_0x5c79e3[_0x11dc('0x22')]+=_0x878bf8[_0xf46029][_0x11dc('0x22')]:(_0x55834b[_0x11dc('0x29')](_0x5c79e3),_0x5c79e3=_0x878bf8[_0xf46029]);return _0x55834b[_0x11dc('0x29')](_0x5c79e3),_0x55834b;}(_0xb5c670);const _0x31dac0=_0x15f0c1[_0x11dc('0x2c')]();return _0xb5c670[_0x11dc('0x36')](_0x966fd0=>_0x966fd0[_0x11dc('0x42')]<=_0x31dac0[_0x11dc('0x42')]&&_0x966fd0[_0x11dc('0x51')]>=_0x31dac0[_0x11dc('0x51')]&&_0x966fd0[_0x11dc('0x27')]<=_0x31dac0['left']&&_0x966fd0[_0x11dc('0x40')]>=_0x31dac0[_0x11dc('0x40')])||_0xb5c670[0x0];}var _0x34a59f;return _0x1a5c8d[_0x11dc('0x2')]||_0x15f0c1;}[_0x11dc('0x50')](_0x4d1f65){this[_0x11dc('0x24')][_0x11dc('0x18')](_0x4d1f65)&&this['_balloon'][_0x11dc('0x6')](_0x4d1f65[_0x11dc('0xa')])&&(this['_addedAnnotations'][_0x11dc('0x11')](_0x4d1f65),this['_balloon'][_0x11dc('0x1a')](_0x4d1f65['view']));}[_0x11dc('0x2a')](_0x830b4f){this['_manuallyClosed'][_0x11dc('0x4b')](_0x830b4f),this[_0x11dc('0x50')](_0x830b4f);}}function F(_0x1c639e,_0x3393b6){return _0x1c639e[_0x11dc('0x42')]===_0x3393b6[_0x11dc('0x42')]&&_0x1c639e['bottom']===_0x3393b6[_0x11dc('0x51')]&&_0x1c639e['right']===_0x3393b6['left'];}
@@ -1,80 +1,81 @@
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
- }
1
+ /**
2
+ * @module comments/annotations/narrowsidebar
3
+ * @publicApi
4
+ */
5
+ import { ContextPlugin, Context, type Editor } from 'ckeditor5/src/core';
6
+ import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis';
7
+ import Sidebar from './sidebar';
8
+ import { BalloonPanelView, BodyCollection } from 'ckeditor5/src/ui';
9
+ import '../../theme/sidebar-narrow.css';
10
+ import type Annotation from './annotation';
11
+ import type { default as AnnotationCollection } from './annotationcollection';
12
+ /**
13
+ * The narrow sidebar UI for displaying annotations.
14
+ *
15
+ * Binds {@link module:comments/annotations/annotations~Annotations} plugin with
16
+ * {@link module:comments/annotations/sidebar~Sidebar} plugin to display annotations in the sidebar as
17
+ * {@link module:comments/annotations/view/annotationcounterbuttonview~AnnotationCounterButtonView small icons}.
18
+ *
19
+ * After selecting an annotation the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} with an
20
+ * {@link module:comments/annotations/view/annotationview~AnnotationView} appears attached to the sidebar item.
21
+ *
22
+ * This UI is intended for medium-sized viewports.
23
+ *
24
+ * To activate this UI use one of the following:
25
+ *
26
+ * ```ts
27
+ * editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'narrowSidebar' );
28
+ * editor.plugins.get( 'AnnotationsUIs' ).activate( 'narrowSidebar', filter );
29
+ * ```
30
+ *
31
+ * See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
32
+ */
33
+ export default class NarrowSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
34
+ /**
35
+ * An active annotation tracked by this UI.
36
+ */
37
+ activeAnnotation: Annotation | null;
38
+ bodyCollection: BodyCollection;
39
+ balloonPanelView: BalloonPanelView;
40
+ isAttached: boolean;
41
+ /**
42
+ * A collection of annotations controlled by this UI.
43
+ *
44
+ * This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
45
+ *
46
+ * It is set to `null` if `NarrowSidebar` is not {@link module:comments/annotations/narrowsidebar~NarrowSidebar#attach attached}.
47
+ */
48
+ annotations: AnnotationCollection | null;
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ static get requires(): readonly [typeof Sidebar, typeof AnnotationsUIs];
53
+ /**
54
+ * @inheritDoc
55
+ */
56
+ static get pluginName(): "NarrowSidebar";
57
+ /**
58
+ * @inheritDoc
59
+ */
60
+ constructor(context: Context | Editor);
61
+ /**
62
+ * @inheritDoc
63
+ */
64
+ init(): void;
65
+ /**
66
+ * @inheritDoc
67
+ */
68
+ attach(annotations: AnnotationCollection): void;
69
+ /**
70
+ * Sets the active annotation for this UI.
71
+ */
72
+ setActiveAnnotation(annotation: Annotation | null): void;
73
+ /**
74
+ * @inheritDoc
75
+ */
76
+ detach(): void;
77
+ /**
78
+ * @inheritDoc
79
+ */
80
+ destroy(): void;
81
+ }