@ckeditor/ckeditor5-comments 38.1.1 → 38.2.0-alpha.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.
- package/build/comments.js +1 -1
- package/package.json +4 -3
- package/src/annotations/annotation.d.ts +86 -86
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.d.ts +94 -94
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.d.ts +150 -150
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.d.ts +228 -228
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +63 -63
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +86 -86
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +81 -81
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.d.ts +96 -96
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -25
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.d.ts +86 -86
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.d.ts +51 -51
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.d.ts +28 -28
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.d.ts +73 -73
- package/src/annotations/widesidebar.js +1 -1
- package/src/augmentation.d.ts +48 -48
- package/src/comments/addcommentthreadcommand.d.ts +31 -31
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.d.ts +27 -27
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.d.ts +34 -34
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.d.ts +75 -75
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1088 -1088
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +29 -29
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -13
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.d.ts +17 -17
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -32
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -27
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -32
- package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
- package/src/comments/ui/commentthreadcontroller.d.ts +64 -64
- package/src/comments/ui/commentthreadcontroller.js +1 -1
- package/src/comments/ui/view/basecommentthreadview.d.ts +108 -108
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.d.ts +108 -108
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -9
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.d.ts +10 -10
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.d.ts +82 -82
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.d.ts +34 -34
- package/src/comments/ui/view/commentsarchiveview.js +1 -1
- package/src/comments/ui/view/commentslistview.d.ts +96 -96
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -46
- package/src/comments/ui/view/commentthreadheaderview.js +1 -1
- package/src/comments/ui/view/commentthreadinputview.d.ts +37 -37
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.d.ts +113 -113
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.d.ts +239 -239
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.d.ts +31 -31
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +29 -29
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +172 -172
- package/src/index.d.ts +21 -21
- package/src/index.js +1 -1
- package/src/utils/common-translations.d.ts +5 -5
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.d.ts +13 -13
- package/src/utils/createmutationobserver.js +1 -1
|
@@ -1,96 +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
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/sidebar
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core.js';
|
|
6
|
+
import type { View } from 'ckeditor5/src/ui.js';
|
|
7
|
+
import SidebarView from './view/sidebarview.js';
|
|
8
|
+
import SidebarItemView from './view/sidebaritemview.js';
|
|
9
|
+
import type Annotation from './annotation.js';
|
|
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
|
|
23
|
+
const _0x6c28=['getIndex','remove','context','minHeight','_setItemTop','_alignAfterItem','targetRect','sidebar.preventScrollOutOfView','bind','class','change:bottom','change:top','_spaceBetweenItems','list','_lastItem','_alignToTargetRect','object','_createSidebarView','render','_alignForBottomChange','set','_getItemAfter','length','locale','Sidebar','_getItemBefore','_annotations','_activeAnnotation','_alignBeforeItem','last','delete','content','get','listenTo','refresh','nodeType','_sidebarItemViewToAnnotation','_destroySidebarItemView','init','height','_getTargetTop','change:targetRect','_annotationToSidebarItemView','max','sidebar-attachtocontainer-missing-container','config','bottom','sidebar.container','view','target','clear','isAnimationDisabled','_updateLastItem','_recalculate','_attachToContainer','stopListening','getSidebarItemView','addAnnotation','_alignForTopChange','top','_recalculateBuffer','change:_lastItem','container','_targetTop','element','define','updateHeight','_getMaxAvailableTop','destroy','isActive'];(function(_0x1bef2f,_0x6c2880){const _0x5c34ec=function(_0x47cd6f){while(--_0x47cd6f){_0x1bef2f['push'](_0x1bef2f['shift']());}};_0x5c34ec(++_0x6c2880);}(_0x6c28,0xd9));const _0x5c34=function(_0x1bef2f,_0x6c2880){_0x1bef2f=_0x1bef2f-0x0;let _0x5c34ec=_0x6c28[_0x1bef2f];return _0x5c34ec;};import{ContextPlugin as _0x11dba3}from'ckeditor5/src/core.js';import{Rect as _0x6b676f,CKEditorError as _0x95ebce}from'ckeditor5/src/utils.js';import _0x2cbdf4 from'./view/sidebarview.js';import _0x4fa075 from'./view/sidebaritemview.js';export default class z extends _0x11dba3{static get['pluginName'](){return _0x5c34('0x11');}constructor(_0x460082){super(_0x460082),this[_0x5c34('0xd')](_0x5c34('0x7'),void 0x0),this['view']=this[_0x5c34('0xa')](),this[_0x5c34('0xd')]('container',null),this[_0x5c34('0x5')]=0x19,this[_0x5c34('0x1d')]=new Map(),this[_0x5c34('0x23')]=new Map(),this[_0x5c34('0x41')]['config'][_0x5c34('0x3a')]('sidebar.preventScrollOutOfView',!0x1),this['_annotations']=null,this['_activeAnnotation']=null,this[_0x5c34('0x35')]=[];}[_0x5c34('0x1f')](){const _0x9ddfb9=this[_0x5c34('0x41')][_0x5c34('0x26')][_0x5c34('0x19')](_0x5c34('0x28'));_0x9ddfb9&&this['setContainer'](_0x9ddfb9);}['setContainer'](_0x567c5a){if(!y(_0x567c5a))throw new _0x95ebce('sidebar-setcontainer-invalid-element');this[_0x5c34('0x37')]=_0x567c5a;}[_0x5c34('0x2f')]({viewClass:_0x10415b='',spaceBetweenItems:_0x2339f3=0x19}={}){if(!y(this[_0x5c34('0x37')]))throw new _0x95ebce(_0x5c34('0x25'),this);this[_0x5c34('0x37')]['appendChild'](this[_0x5c34('0x29')][_0x5c34('0x39')]),this[_0x5c34('0x29')][_0x5c34('0x2')]=_0x10415b,this[_0x5c34('0x5')]=_0x2339f3;}['rearrange']({removedAnnotation:_0x2e4bd9,previousAnnotation:_0x5c8e05,nextAnnotation:_0x552391}){const _0x2b8e8d=this[_0x5c34('0x31')](_0x2e4bd9);this[_0x5c34('0x29')][_0x5c34('0x6')][_0x5c34('0x40')](_0x2b8e8d),this[_0x5c34('0x1e')](_0x2e4bd9),_0x5c8e05&&this[_0x5c34('0x8')](this[_0x5c34('0x31')](_0x5c8e05)),_0x552391&&this[_0x5c34('0x8')](this[_0x5c34('0x31')](_0x552391)),this[_0x5c34('0x2d')]();}[_0x5c34('0x1b')]({blurredAnnotation:_0x51046d,activatedAnnotation:_0x133719,disableAnimationOnActivatedAnnotation:_0x3c20a5}){if(this['_activeAnnotation']=_0x133719,_0x51046d){_0x51046d[_0x5c34('0x3e')]=!0x1;const _0x489845=this[_0x5c34('0x31')](_0x51046d);_0x489845&&_0x3c20a5&&(_0x489845[_0x5c34('0x2c')]=!0x1);}if(_0x133719){const _0x421bf6=this[_0x5c34('0x31')](_0x133719);_0x421bf6&&(_0x133719[_0x5c34('0x3e')]=!0x0,_0x3c20a5&&(_0x421bf6[_0x5c34('0x2c')]=!0x0,_0x421bf6[_0x5c34('0x34')]+=0x1),this[_0x5c34('0x8')](_0x421bf6));}}['_detachFromContainer'](_0x535684){if(this[_0x5c34('0x29')]['element'][_0x5c34('0x40')](),_0x535684)for(const _0x7cecb1 of _0x535684)this['_destroySidebarItemView'](_0x7cecb1);this[_0x5c34('0x29')][_0x5c34('0x6')][_0x5c34('0x2b')](),this[_0x5c34('0x29')][_0x5c34('0x2')]='',this[_0x5c34('0x7')]=null;}[_0x5c34('0x32')](_0x45f56f,_0x2c59e7){_0x2c59e7||(_0x2c59e7=_0x45f56f['view']);const _0x6808bc=new _0x4fa075(this['context'][_0x5c34('0x10')]);this[_0x5c34('0x1d')]['set'](_0x6808bc,_0x45f56f),this[_0x5c34('0x23')][_0x5c34('0xd')](_0x45f56f,_0x6808bc),_0x6808bc[_0x5c34('0x18')]['add'](_0x2c59e7),this['listenTo'](_0x45f56f[_0x5c34('0x29')],_0x5c34('0x22'),(_0x2eac6,_0x559715,_0x504ef7)=>{const _0x18ab1=this[_0x5c34('0x21')](_0x45f56f,_0x504ef7);_0x6808bc[_0x5c34('0x38')]!=_0x18ab1&&(_0x6808bc[_0x5c34('0x38')]=_0x18ab1,this[_0x5c34('0x43')](_0x6808bc,_0x18ab1));}),this['listenTo'](_0x6808bc,_0x5c34('0x4'),()=>{this[_0x5c34('0x2e')](_0x6808bc,_0x5c34('0x34'));}),this[_0x5c34('0x1a')](_0x6808bc,_0x5c34('0x3'),()=>{this[_0x5c34('0x2e')](_0x6808bc,_0x5c34('0x27'));}),this['_alignToTargetRect'](_0x6808bc);const _0x5bbc6d=this['_getItemBefore'](_0x6808bc);if(_0x5bbc6d)this['_alignAfterItem'](_0x5bbc6d,_0x6808bc)||this['_alignToTargetRect'](_0x6808bc);else this[_0x5c34('0x8')](_0x6808bc);return this['_updateLastItem'](),this[_0x5c34('0x29')][_0x5c34('0x6')]['add'](_0x6808bc),_0x6808bc;}['_alignForTopChange'](_0x2e1626){if(!_0x2e1626['content']['length'])return;const _0xff19b9=this[_0x5c34('0x12')](_0x2e1626);if(!_0xff19b9)return;const _0x57b9cd=this['_sidebarItemViewToAnnotation'][_0x5c34('0x19')](_0xff19b9),_0x2f57bf=this[_0x5c34('0x14')];_0x2f57bf&&_0x2f57bf===_0x57b9cd?this[_0x5c34('0x44')](_0xff19b9,_0x2e1626):this['_alignBeforeItem'](_0x2e1626,_0xff19b9);}[_0x5c34('0xc')](_0x4a471e){if(!_0x4a471e[_0x5c34('0x18')]['length'])return;const _0x369c8d=this[_0x5c34('0xe')](_0x4a471e);if(!_0x369c8d)return;const _0x21b3a3=this[_0x5c34('0x1d')][_0x5c34('0x19')](_0x369c8d),_0x484fe6=this[_0x5c34('0x41')][_0x5c34('0x26')][_0x5c34('0x19')](_0x5c34('0x0')),_0x1a948c=this[_0x5c34('0x14')];_0x1a948c&&_0x1a948c===_0x21b3a3&&_0x484fe6?(this[_0x5c34('0x15')](_0x369c8d,_0x4a471e),this['_alignAfterItem'](_0x4a471e,_0x369c8d)):_0x1a948c&&_0x1a948c===_0x21b3a3?this[_0x5c34('0x15')](_0x369c8d,_0x4a471e):this[_0x5c34('0x44')](_0x4a471e,_0x369c8d);}[_0x5c34('0x2e')](_0xcf966d,_0xde88f1){0x0===this['_recalculateBuffer'][_0x5c34('0xf')]&&setTimeout(()=>{for(const {sidebarItemView:_0x9061f8,changedProp:_0x1f6d4c}of this[_0x5c34('0x35')])_0x5c34('0x34')===_0x1f6d4c?this[_0x5c34('0x33')](_0x9061f8):this[_0x5c34('0xc')](_0x9061f8);this['_recalculateBuffer']=[];},0xa),this[_0x5c34('0x35')]['push']({'sidebarItemView':_0xcf966d,'changedProp':_0xde88f1});}['getSidebarItemView'](_0x5ed5cf){return this['_annotationToSidebarItemView'][_0x5c34('0x19')](_0x5ed5cf);}[_0x5c34('0x3d')](){this[_0x5c34('0x30')](),this[_0x5c34('0x29')][_0x5c34('0x3d')]();}['_destroySidebarItemView'](_0x26bb88){const _0x155e34=this[_0x5c34('0x31')](_0x26bb88);this['stopListening'](_0x155e34),this[_0x5c34('0x30')](_0x26bb88[_0x5c34('0x29')]),_0x155e34[_0x5c34('0x3d')](),this[_0x5c34('0x23')][_0x5c34('0x17')](_0x26bb88),this[_0x5c34('0x1d')][_0x5c34('0x17')](_0x155e34);}[_0x5c34('0xa')](){const _0x13dc63=new _0x2cbdf4(this[_0x5c34('0x41')][_0x5c34('0x10')]);return _0x13dc63[_0x5c34('0xb')](),this['on'](_0x5c34('0x36'),(_0x58ff4f,_0x168047,_0x55ef8b,_0x34667c)=>{_0x34667c&&_0x13dc63['unbind'](_0x5c34('0x42')),_0x55ef8b?_0x13dc63[_0x5c34('0x1')](_0x5c34('0x42'))['to'](_0x55ef8b,_0x5c34('0x27')):_0x13dc63[_0x5c34('0x42')]=null;}),_0x13dc63;}[_0x5c34('0x2d')](){var _0x324a58;this[_0x5c34('0x7')]=(null===(_0x324a58=this[_0x5c34('0x13')])||void 0x0===_0x324a58?void 0x0:_0x324a58[_0x5c34('0x16')])?this[_0x5c34('0x31')](this[_0x5c34('0x13')][_0x5c34('0x16')]):null;}['_getItemBefore'](_0x99439a){var _0x34b021;const _0x419ca5=this[_0x5c34('0x1d')][_0x5c34('0x19')](_0x99439a),_0x63811f=_0x419ca5&&(null===(_0x34b021=this['_annotations'])||void 0x0===_0x34b021?void 0x0:_0x34b021[_0x5c34('0x19')](this[_0x5c34('0x13')][_0x5c34('0x3f')](_0x419ca5)-0x1));return _0x63811f&&this[_0x5c34('0x31')](_0x63811f)||null;}[_0x5c34('0xe')](_0x3ac7fe){var _0x324e17;const _0x157060=this[_0x5c34('0x1d')][_0x5c34('0x19')](_0x3ac7fe),_0x3aff75=_0x157060&&(null===(_0x324e17=this[_0x5c34('0x13')])||void 0x0===_0x324e17?void 0x0:_0x324e17[_0x5c34('0x19')](this[_0x5c34('0x13')][_0x5c34('0x3f')](_0x157060)+0x1));return _0x3aff75&&this[_0x5c34('0x31')](_0x3aff75)||null;}[_0x5c34('0x15')](_0x2d9c39,_0x1c84d3){_0x2d9c39[_0x5c34('0x3b')]();const _0x2e1ab4=M(_0x1c84d3['bottom']+this[_0x5c34('0x5')],_0x2d9c39[_0x5c34('0x34')]);return!!_0x2e1ab4&&(this['_setItemTop'](_0x1c84d3,_0x1c84d3['top']-_0x2e1ab4),!0x0);}[_0x5c34('0x44')](_0x49a022,_0x3f0bde){_0x49a022[_0x5c34('0x3b')]();const _0x27c3ae=M(_0x49a022['bottom']+this['_spaceBetweenItems'],_0x3f0bde['top']);return!!_0x27c3ae&&(this[_0x5c34('0x43')](_0x3f0bde,_0x3f0bde[_0x5c34('0x34')]+_0x27c3ae,!0x1),!0x0);}['_alignToTargetRect'](_0x2f7750){const _0x325063=this[_0x5c34('0x1d')]['get'](_0x2f7750);if(!_0x325063||!_0x325063[_0x5c34('0x2a')]||!_0x325063['targetRect'])return;const _0x351e54=this[_0x5c34('0x21')](_0x325063,_0x325063[_0x5c34('0x45')]);this[_0x5c34('0x43')](_0x2f7750,_0x351e54);}['_getTargetTop'](_0x39c090,_0x1b1d68){if(null===_0x1b1d68)return 0x0;if(_0x39c090[_0x5c34('0x2a')]instanceof _0x6b676f)return _0x1b1d68[_0x5c34('0x34')];{const _0x209fec=new _0x6b676f(this[_0x5c34('0x29')][_0x5c34('0x39')])[_0x5c34('0x34')];return _0x1b1d68[_0x5c34('0x34')]-_0x209fec;}}['_setItemTop'](_0x373311,_0x1465a0,_0x16bd11=this['context'][_0x5c34('0x26')][_0x5c34('0x19')](_0x5c34('0x0'))){_0x16bd11&&(_0x1465a0=Math[_0x5c34('0x24')](_0x1465a0,this[_0x5c34('0x3c')](_0x373311))),_0x373311[_0x5c34('0x34')]=_0x1465a0;}[_0x5c34('0x3c')](_0x3f696e){let _0x147cdc=this['_getItemBefore'](_0x3f696e),_0x255e4e=0x0;for(;_0x147cdc;)_0x147cdc['updateHeight'](),_0x255e4e+=this['_spaceBetweenItems']+_0x147cdc[_0x5c34('0x20')],_0x147cdc=this[_0x5c34('0x12')](_0x147cdc);return _0x255e4e;}}function M(_0x49b237,_0x4f9b5f){return Math['max'](_0x49b237-_0x4f9b5f,0x0);}function y(_0x3be8fd){return null!==_0x3be8fd&&_0x5c34('0x9')==typeof _0x3be8fd&&0x1===_0x3be8fd[_0x5c34('0x1c')];}
|
|
@@ -1,25 +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
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/view/annotationcounterbuttonview
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { ButtonView, View } from 'ckeditor5/src/ui.js';
|
|
6
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
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
|
|
23
|
+
const _0x100c=['bind','children','isDirty','_badge','span','annotationType','counterView','toString','set','ck-annotation-counter__badge','ck-annotation-counter__badge--','...','number','add','ck-annotation-counter','icon'];(function(_0x508987,_0x100cf4){const _0x554a46=function(_0x167d09){while(--_0x167d09){_0x508987['push'](_0x508987['shift']());}};_0x554a46(++_0x100cf4);}(_0x100c,0x1b6));const _0x554a=function(_0x508987,_0x100cf4){_0x508987=_0x508987-0x0;let _0x554a46=_0x100c[_0x508987];return _0x554a46;};import{ButtonView as _0x2ac189,View as _0x50cfb4}from'ckeditor5/src/ui.js';import _0x3b6bac from'../../../theme/icons/add-comment.svg';export default class D extends _0x2ac189{constructor(_0x51956e){super(_0x51956e);const _0x20bc60=this['bindTemplate'];this[_0x554a('0x2')](_0x554a('0xc'),!0x1),this[_0x554a('0x2')](_0x554a('0x6'),0x0),this[_0x554a('0xa')](_0x554a('0xd'))['to'](this,_0x554a('0xc'),this,_0x554a('0x6'),(_0x23d2a2,_0x22d9a4)=>_0x23d2a2?_0x554a('0x5'):_0x22d9a4[_0x554a('0x1')]()),this[_0x554a('0x2')](_0x554a('0xf'),''),this[_0x554a('0x9')]=_0x3b6bac,this['extendTemplate']({'attributes':{'class':[_0x554a('0x8')]}}),this[_0x554a('0x0')]=new _0x50cfb4(),this['counterView']['setTemplate']({'tag':_0x554a('0xe'),'attributes':{'class':[_0x554a('0x3'),_0x20bc60['to'](_0x554a('0xf'),_0x57c89c=>_0x554a('0x4')+_0x57c89c),_0x20bc60['if'](_0x554a('0xc'),'ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x20bc60['to']('_badge')}]}),this[_0x554a('0xb')][_0x554a('0x7')](this['counterView']);}}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/annotations/view/annotationview
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { View, type ViewCollection } from 'ckeditor5/src/ui';
|
|
6
|
-
import { FocusTracker, KeystrokeHandler, type Rect, type Locale } from 'ckeditor5/src/utils';
|
|
7
|
-
import '../../../theme/annotation.css';
|
|
8
|
-
/**
|
|
9
|
-
* A wrapping view for any view added to the `Annotations` plugin.
|
|
10
|
-
*
|
|
11
|
-
* It introduces functionalities that make the given view ready to be used as an annotation, such as focus tracking, height resizing,
|
|
12
|
-
* and other observable properties that help share current annotation state across different UIs.
|
|
13
|
-
*/
|
|
14
|
-
export default class AnnotationView extends View {
|
|
15
|
-
/**
|
|
16
|
-
* Tracks focus on the annotation view.
|
|
17
|
-
*
|
|
18
|
-
* Add a DOM element to this focus tracker to prevent blurring annotation view
|
|
19
|
-
* when the DOM element is focused.
|
|
20
|
-
*/
|
|
21
|
-
readonly focusTracker: FocusTracker;
|
|
22
|
-
readonly id: string;
|
|
23
|
-
readonly keystrokes: KeystrokeHandler;
|
|
24
|
-
/**
|
|
25
|
-
* Target rectangle to which the annotation should be attached.
|
|
26
|
-
*
|
|
27
|
-
* @observable
|
|
28
|
-
*/
|
|
29
|
-
targetRect: Rect | null;
|
|
30
|
-
/**
|
|
31
|
-
* Annotation view height.
|
|
32
|
-
*
|
|
33
|
-
* @observable
|
|
34
|
-
*/
|
|
35
|
-
height: number;
|
|
36
|
-
/**
|
|
37
|
-
* Informs if an annotation is active.
|
|
38
|
-
*
|
|
39
|
-
* @observable
|
|
40
|
-
*/
|
|
41
|
-
isActive: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Informs if there are unsaved changes in the annotation.
|
|
44
|
-
*
|
|
45
|
-
* @observable
|
|
46
|
-
*/
|
|
47
|
-
isDirty: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* The number of items in the annotation.
|
|
50
|
-
*
|
|
51
|
-
* @observable
|
|
52
|
-
*/
|
|
53
|
-
length: number;
|
|
54
|
-
/**
|
|
55
|
-
* @observable
|
|
56
|
-
*/
|
|
57
|
-
type: string;
|
|
58
|
-
element: HTMLElement;
|
|
59
|
-
/**
|
|
60
|
-
* Collection for content views.
|
|
61
|
-
*/
|
|
62
|
-
content: ViewCollection;
|
|
63
|
-
/**
|
|
64
|
-
* The inner annotation view.
|
|
65
|
-
*/
|
|
66
|
-
mainView: AnnotationMainView;
|
|
67
|
-
/**
|
|
68
|
-
* @inheritDoc
|
|
69
|
-
*/
|
|
70
|
-
constructor(locale: Locale, mainView: AnnotationMainView);
|
|
71
|
-
/**
|
|
72
|
-
* @inheritDoc
|
|
73
|
-
*/
|
|
74
|
-
render(): void;
|
|
75
|
-
/**
|
|
76
|
-
* @inheritDoc
|
|
77
|
-
*/
|
|
78
|
-
destroy(): void;
|
|
79
|
-
/**
|
|
80
|
-
* Focuses the annotation view.
|
|
81
|
-
*/
|
|
82
|
-
focus(): void;
|
|
83
|
-
}
|
|
84
|
-
export interface AnnotationMainView extends View {
|
|
85
|
-
isActive: boolean;
|
|
86
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/view/annotationview
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
|
|
6
|
+
import { FocusTracker, KeystrokeHandler, type Rect, type Locale } from 'ckeditor5/src/utils.js';
|
|
7
|
+
import '../../../theme/annotation.css';
|
|
8
|
+
/**
|
|
9
|
+
* A wrapping view for any view added to the `Annotations` plugin.
|
|
10
|
+
*
|
|
11
|
+
* It introduces functionalities that make the given view ready to be used as an annotation, such as focus tracking, height resizing,
|
|
12
|
+
* and other observable properties that help share current annotation state across different UIs.
|
|
13
|
+
*/
|
|
14
|
+
export default class AnnotationView extends View {
|
|
15
|
+
/**
|
|
16
|
+
* Tracks focus on the annotation view.
|
|
17
|
+
*
|
|
18
|
+
* Add a DOM element to this focus tracker to prevent blurring annotation view
|
|
19
|
+
* when the DOM element is focused.
|
|
20
|
+
*/
|
|
21
|
+
readonly focusTracker: FocusTracker;
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly keystrokes: KeystrokeHandler;
|
|
24
|
+
/**
|
|
25
|
+
* Target rectangle to which the annotation should be attached.
|
|
26
|
+
*
|
|
27
|
+
* @observable
|
|
28
|
+
*/
|
|
29
|
+
targetRect: Rect | null;
|
|
30
|
+
/**
|
|
31
|
+
* Annotation view height.
|
|
32
|
+
*
|
|
33
|
+
* @observable
|
|
34
|
+
*/
|
|
35
|
+
height: number;
|
|
36
|
+
/**
|
|
37
|
+
* Informs if an annotation is active.
|
|
38
|
+
*
|
|
39
|
+
* @observable
|
|
40
|
+
*/
|
|
41
|
+
isActive: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Informs if there are unsaved changes in the annotation.
|
|
44
|
+
*
|
|
45
|
+
* @observable
|
|
46
|
+
*/
|
|
47
|
+
isDirty: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The number of items in the annotation.
|
|
50
|
+
*
|
|
51
|
+
* @observable
|
|
52
|
+
*/
|
|
53
|
+
length: number;
|
|
54
|
+
/**
|
|
55
|
+
* @observable
|
|
56
|
+
*/
|
|
57
|
+
type: string;
|
|
58
|
+
element: HTMLElement;
|
|
59
|
+
/**
|
|
60
|
+
* Collection for content views.
|
|
61
|
+
*/
|
|
62
|
+
content: ViewCollection;
|
|
63
|
+
/**
|
|
64
|
+
* The inner annotation view.
|
|
65
|
+
*/
|
|
66
|
+
mainView: AnnotationMainView;
|
|
67
|
+
/**
|
|
68
|
+
* @inheritDoc
|
|
69
|
+
*/
|
|
70
|
+
constructor(locale: Locale, mainView: AnnotationMainView);
|
|
71
|
+
/**
|
|
72
|
+
* @inheritDoc
|
|
73
|
+
*/
|
|
74
|
+
render(): void;
|
|
75
|
+
/**
|
|
76
|
+
* @inheritDoc
|
|
77
|
+
*/
|
|
78
|
+
destroy(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Focuses the annotation view.
|
|
81
|
+
*/
|
|
82
|
+
focus(): void;
|
|
83
|
+
}
|
|
84
|
+
export interface AnnotationMainView extends View {
|
|
85
|
+
isActive: boolean;
|
|
86
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x23bf=['length','element','height','setTemplate','attach','isDirty','content','focus','mainView','_mutationObserver','clear','isActive','set','detach','targetRect','Esc','keystrokes','type','_updateHeight','destroy','ck-annotation-wrapper--active','clientHeight','add','render','focusTracker','createCollection','ck-annotation-wrapper','ck-rounded-corners'];(function(_0x42a0d0,_0x23bf09){const _0x36ca5d=function(_0x421dc8){while(--_0x421dc8){_0x42a0d0['push'](_0x42a0d0['shift']());}};_0x36ca5d(++_0x23bf09);}(_0x23bf,0x17c));const _0x36ca=function(_0x42a0d0,_0x23bf09){_0x42a0d0=_0x42a0d0-0x0;let _0x36ca5d=_0x23bf[_0x42a0d0];return _0x36ca5d;};import{View as _0x7a994}from'ckeditor5/src/ui.js';import{FocusTracker as _0x449993,KeystrokeHandler as _0x453a94,uid as _0x19961b}from'ckeditor5/src/utils.js';import _0x5e3c78 from'../../utils/createmutationobserver.js';import'../../../theme/annotation.css';export default class V extends _0x7a994{constructor(_0x1be4d8,_0x472f11){super(_0x1be4d8),this['id']=_0x19961b(),this[_0x36ca('0x8')]=new _0x449993(),this['keystrokes']=new _0x453a94(),this['keystrokes'][_0x36ca('0x18')](_0x36ca('0x1b'),(_0x2c11c9,_0x4719f3)=>this['fire'](_0x36ca('0x1b'),_0x4719f3)),this[_0x36ca('0x18')](_0x36ca('0x1a'),{'top':0x0,'right':0x0,'bottom':0x0,'left':0x0}),this[_0x36ca('0x18')](_0x36ca('0xe'),0x0),this['set']('isActive',!0x1),this['set'](_0x36ca('0x11'),!0x1),this[_0x36ca('0x18')](_0x36ca('0xc'),0x0),this[_0x36ca('0x18')](_0x36ca('0x1'),''),this[_0x36ca('0x15')]=_0x5e3c78(()=>this[_0x36ca('0x2')]()),this[_0x36ca('0x12')]=this[_0x36ca('0x9')](),this[_0x36ca('0x12')]['add'](_0x472f11),this[_0x36ca('0x14')]=_0x472f11;const _0x1cf353=this['bindTemplate'];this[_0x36ca('0xf')]({'tag':'div','attributes':{'class':['ck',_0x36ca('0xa'),_0x36ca('0xb'),_0x1cf353['if'](_0x36ca('0x17'),_0x36ca('0x4'))],'tabindex':-0x1},'children':this[_0x36ca('0x12')]});}['render'](){super[_0x36ca('0x7')](),this[_0x36ca('0x8')][_0x36ca('0x6')](this[_0x36ca('0xd')]),this[_0x36ca('0x0')]['listenTo'](this[_0x36ca('0xd')]),this[_0x36ca('0x15')][_0x36ca('0x10')](this['element']);}['destroy'](){this[_0x36ca('0x12')][_0x36ca('0x16')](),this[_0x36ca('0x0')][_0x36ca('0x3')](),this[_0x36ca('0x8')][_0x36ca('0x3')](),this['_mutationObserver'][_0x36ca('0x19')](),super['destroy']();}[_0x36ca('0x13')](){this[_0x36ca('0xd')][_0x36ca('0x13')]();}['_updateHeight'](){const _0x527b91=this[_0x36ca('0xd')][_0x36ca('0x5')];_0x527b91&&(this[_0x36ca('0xe')]=_0x527b91);}}
|