@ckeditor/ckeditor5-comments 38.1.0 → 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.
- package/build/comments.js +1 -1
- package/package.json +3 -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/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';
|
|
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
|
|
23
|
+
const _0x3bab=['bind','getSidebarItemView','view','_recalculate','_attachToContainer','minHeight','_recalculateBuffer','content','add','stopListening','Sidebar','change:_lastItem','_createSidebarView','_destroySidebarItemView','define','bottom','set','_alignForTopChange','_annotations','length','element','_sidebarItemViewToAnnotation','isActive','unbind','listenTo','_lastItem','sidebar.container','_targetTop','_setItemTop','_alignAfterItem','targetRect','getIndex','_alignForBottomChange','top','push','_getTargetTop','_getItemBefore','_annotationToSidebarItemView','_alignBeforeItem','isAnimationDisabled','_getItemAfter','_spaceBetweenItems','context','setContainer','remove','last','get','container','change:targetRect','nodeType','target','list','locale','config','_alignToTargetRect','class','refresh','pluginName','object','sidebar.preventScrollOutOfView','height','destroy','_getMaxAvailableTop','_activeAnnotation','delete','addAnnotation','max','_updateLastItem','updateHeight','appendChild'];(function(_0x14b031,_0x3bab67){const _0x4f9b2d=function(_0x185d62){while(--_0x185d62){_0x14b031['push'](_0x14b031['shift']());}};_0x4f9b2d(++_0x3bab67);}(_0x3bab,0xba));const _0x4f9b=function(_0x14b031,_0x3bab67){_0x14b031=_0x14b031-0x0;let _0x4f9b2d=_0x3bab[_0x14b031];return _0x4f9b2d;};import{ContextPlugin as _0xf8adb8}from'ckeditor5/src/core';import{Rect as _0x1e0c47,CKEditorError as _0x3bc4dc}from'ckeditor5/src/utils';import _0x81af48 from'./view/sidebarview';import _0x20ba33 from'./view/sidebaritemview';export default class z extends _0xf8adb8{static get[_0x4f9b('0xb')](){return _0x4f9b('0x22');}constructor(_0x3d17b5){super(_0x3d17b5),this[_0x4f9b('0x28')](_0x4f9b('0x31'),void 0x0),this[_0x4f9b('0x1a')]=this[_0x4f9b('0x24')](),this['set'](_0x4f9b('0x1'),null),this['_spaceBetweenItems']=0x19,this[_0x4f9b('0x2d')]=new Map(),this[_0x4f9b('0x3d')]=new Map(),this[_0x4f9b('0x42')][_0x4f9b('0x7')][_0x4f9b('0x26')](_0x4f9b('0xd'),!0x1),this[_0x4f9b('0x2a')]=null,this[_0x4f9b('0x11')]=null,this[_0x4f9b('0x1e')]=[];}['init'](){const _0x2643fb=this[_0x4f9b('0x42')][_0x4f9b('0x7')][_0x4f9b('0x0')](_0x4f9b('0x32'));_0x2643fb&&this[_0x4f9b('0x43')](_0x2643fb);}[_0x4f9b('0x43')](_0xbaa845){if(!y(_0xbaa845))throw new _0x3bc4dc('sidebar-setcontainer-invalid-element');this[_0x4f9b('0x1')]=_0xbaa845;}[_0x4f9b('0x1c')]({viewClass:_0x569449='',spaceBetweenItems:_0x436bd4=0x19}={}){if(!y(this['container']))throw new _0x3bc4dc('sidebar-attachtocontainer-missing-container',this);this[_0x4f9b('0x1')][_0x4f9b('0x17')](this[_0x4f9b('0x1a')][_0x4f9b('0x2c')]),this[_0x4f9b('0x1a')][_0x4f9b('0x9')]=_0x569449,this[_0x4f9b('0x41')]=_0x436bd4;}['rearrange']({removedAnnotation:_0x3fab40,previousAnnotation:_0x3cf8b6,nextAnnotation:_0x4a7a40}){const _0x131904=this['getSidebarItemView'](_0x3fab40);this[_0x4f9b('0x1a')][_0x4f9b('0x5')][_0x4f9b('0x44')](_0x131904),this['_destroySidebarItemView'](_0x3fab40),_0x3cf8b6&&this[_0x4f9b('0x8')](this[_0x4f9b('0x19')](_0x3cf8b6)),_0x4a7a40&&this['_alignToTargetRect'](this['getSidebarItemView'](_0x4a7a40)),this['_updateLastItem']();}[_0x4f9b('0xa')]({blurredAnnotation:_0x5148fe,activatedAnnotation:_0x4f1367,disableAnimationOnActivatedAnnotation:_0x315a0d}){if(this[_0x4f9b('0x11')]=_0x4f1367,_0x5148fe){_0x5148fe[_0x4f9b('0x2e')]=!0x1;const _0x2a58f8=this[_0x4f9b('0x19')](_0x5148fe);_0x2a58f8&&_0x315a0d&&(_0x2a58f8['isAnimationDisabled']=!0x1);}if(_0x4f1367){const _0x988d7e=this['getSidebarItemView'](_0x4f1367);_0x988d7e&&(_0x4f1367[_0x4f9b('0x2e')]=!0x0,_0x315a0d&&(_0x988d7e[_0x4f9b('0x3f')]=!0x0,_0x988d7e[_0x4f9b('0x39')]+=0x1),this[_0x4f9b('0x8')](_0x988d7e));}}['_detachFromContainer'](_0xd727db){if(this['stopListening'](),this[_0x4f9b('0x1a')]['element'][_0x4f9b('0x44')](),_0xd727db)for(const _0x362938 of _0xd727db)this['_destroySidebarItemView'](_0x362938);this[_0x4f9b('0x1a')][_0x4f9b('0x5')]['clear'](),this[_0x4f9b('0x1a')][_0x4f9b('0x9')]='',this['_lastItem']=null;}[_0x4f9b('0x13')](_0x1b1943,_0xe4f9f3){_0xe4f9f3||(_0xe4f9f3=_0x1b1943[_0x4f9b('0x1a')]);const _0x43dcf5=new _0x20ba33(this[_0x4f9b('0x42')][_0x4f9b('0x6')]);this['_sidebarItemViewToAnnotation'][_0x4f9b('0x28')](_0x43dcf5,_0x1b1943),this[_0x4f9b('0x3d')][_0x4f9b('0x28')](_0x1b1943,_0x43dcf5),_0x43dcf5[_0x4f9b('0x1f')][_0x4f9b('0x20')](_0xe4f9f3),this['listenTo'](_0x1b1943[_0x4f9b('0x1a')],_0x4f9b('0x2'),(_0xe4ecf4,_0x30b392,_0xe3f31d)=>{const _0x1a5180=this[_0x4f9b('0x3b')](_0x1b1943,_0xe3f31d);_0x43dcf5[_0x4f9b('0x33')]!=_0x1a5180&&(_0x43dcf5[_0x4f9b('0x33')]=_0x1a5180,this[_0x4f9b('0x34')](_0x43dcf5,_0x1a5180));}),this[_0x4f9b('0x30')](_0x43dcf5,'change:top',()=>{this['_recalculate'](_0x43dcf5,'top');}),this[_0x4f9b('0x30')](_0x43dcf5,'change:bottom',()=>{this[_0x4f9b('0x1b')](_0x43dcf5,_0x4f9b('0x27'));}),this[_0x4f9b('0x8')](_0x43dcf5);const _0x21a962=this['_getItemBefore'](_0x43dcf5);if(_0x21a962)this[_0x4f9b('0x35')](_0x21a962,_0x43dcf5)||this[_0x4f9b('0x8')](_0x43dcf5);else this['_alignToTargetRect'](_0x43dcf5);return this[_0x4f9b('0x15')](),this['view'][_0x4f9b('0x5')]['add'](_0x43dcf5),_0x43dcf5;}[_0x4f9b('0x29')](_0x45981e){if(!_0x45981e[_0x4f9b('0x1f')][_0x4f9b('0x2b')])return;const _0x4e4875=this['_getItemBefore'](_0x45981e);if(!_0x4e4875)return;const _0x4dc6eb=this[_0x4f9b('0x2d')]['get'](_0x4e4875),_0x185ada=this[_0x4f9b('0x11')];_0x185ada&&_0x185ada===_0x4dc6eb?this[_0x4f9b('0x35')](_0x4e4875,_0x45981e):this[_0x4f9b('0x3e')](_0x45981e,_0x4e4875);}['_alignForBottomChange'](_0x476b19){if(!_0x476b19[_0x4f9b('0x1f')][_0x4f9b('0x2b')])return;const _0xba35d5=this[_0x4f9b('0x40')](_0x476b19);if(!_0xba35d5)return;const _0x4ec154=this[_0x4f9b('0x2d')][_0x4f9b('0x0')](_0xba35d5),_0x3d0768=this['context'][_0x4f9b('0x7')][_0x4f9b('0x0')](_0x4f9b('0xd')),_0x3595ca=this[_0x4f9b('0x11')];_0x3595ca&&_0x3595ca===_0x4ec154&&_0x3d0768?(this[_0x4f9b('0x3e')](_0xba35d5,_0x476b19),this[_0x4f9b('0x35')](_0x476b19,_0xba35d5)):_0x3595ca&&_0x3595ca===_0x4ec154?this['_alignBeforeItem'](_0xba35d5,_0x476b19):this[_0x4f9b('0x35')](_0x476b19,_0xba35d5);}[_0x4f9b('0x1b')](_0x5d5537,_0x3354d2){0x0===this[_0x4f9b('0x1e')]['length']&&setTimeout(()=>{for(const {sidebarItemView:_0xc5741b,changedProp:_0x5156d1}of this['_recalculateBuffer'])_0x4f9b('0x39')===_0x5156d1?this[_0x4f9b('0x29')](_0xc5741b):this[_0x4f9b('0x38')](_0xc5741b);this[_0x4f9b('0x1e')]=[];},0xa),this['_recalculateBuffer'][_0x4f9b('0x3a')]({'sidebarItemView':_0x5d5537,'changedProp':_0x3354d2});}[_0x4f9b('0x19')](_0x3bc564){return this[_0x4f9b('0x3d')][_0x4f9b('0x0')](_0x3bc564);}[_0x4f9b('0xf')](){this[_0x4f9b('0x1a')]['destroy']();}[_0x4f9b('0x25')](_0x50a8da){const _0x4b67a8=this[_0x4f9b('0x19')](_0x50a8da);this[_0x4f9b('0x21')](_0x4b67a8),this[_0x4f9b('0x21')](_0x50a8da[_0x4f9b('0x1a')]),_0x4b67a8[_0x4f9b('0xf')](),this[_0x4f9b('0x3d')][_0x4f9b('0x12')](_0x50a8da),this['_sidebarItemViewToAnnotation'][_0x4f9b('0x12')](_0x4b67a8);}['_createSidebarView'](){const _0x3f1134=new _0x81af48(this[_0x4f9b('0x42')][_0x4f9b('0x6')]);return _0x3f1134['render'](),this['on'](_0x4f9b('0x23'),(_0x32bc99,_0x3ac888,_0x3f7755,_0x40458c)=>{_0x40458c&&_0x3f1134[_0x4f9b('0x2f')](_0x4f9b('0x1d')),_0x3f7755?_0x3f1134[_0x4f9b('0x18')](_0x4f9b('0x1d'))['to'](_0x3f7755,'bottom'):_0x3f1134[_0x4f9b('0x1d')]=null;}),_0x3f1134;}[_0x4f9b('0x15')](){var _0x762803;this[_0x4f9b('0x31')]=(null===(_0x762803=this['_annotations'])||void 0x0===_0x762803?void 0x0:_0x762803[_0x4f9b('0x45')])?this[_0x4f9b('0x19')](this[_0x4f9b('0x2a')][_0x4f9b('0x45')]):null;}[_0x4f9b('0x3c')](_0x7c7af6){var _0x4d8ad9;const _0x6ccdda=this[_0x4f9b('0x2d')][_0x4f9b('0x0')](_0x7c7af6),_0x21ede9=_0x6ccdda&&(null===(_0x4d8ad9=this['_annotations'])||void 0x0===_0x4d8ad9?void 0x0:_0x4d8ad9['get'](this[_0x4f9b('0x2a')]['getIndex'](_0x6ccdda)-0x1));return _0x21ede9&&this['getSidebarItemView'](_0x21ede9)||null;}[_0x4f9b('0x40')](_0x3dabcf){var _0x1a5937;const _0x1fbf48=this[_0x4f9b('0x2d')][_0x4f9b('0x0')](_0x3dabcf),_0x3b4312=_0x1fbf48&&(null===(_0x1a5937=this['_annotations'])||void 0x0===_0x1a5937?void 0x0:_0x1a5937[_0x4f9b('0x0')](this[_0x4f9b('0x2a')][_0x4f9b('0x37')](_0x1fbf48)+0x1));return _0x3b4312&&this[_0x4f9b('0x19')](_0x3b4312)||null;}['_alignBeforeItem'](_0x1e03c8,_0xadc272){_0x1e03c8['updateHeight']();const _0x142354=H(_0xadc272[_0x4f9b('0x27')]+this[_0x4f9b('0x41')],_0x1e03c8['top']);return!!_0x142354&&(this[_0x4f9b('0x34')](_0xadc272,_0xadc272['top']-_0x142354),!0x0);}[_0x4f9b('0x35')](_0x559f5e,_0x38b176){_0x559f5e[_0x4f9b('0x16')]();const _0x19b3a4=H(_0x559f5e[_0x4f9b('0x27')]+this[_0x4f9b('0x41')],_0x38b176['top']);return!!_0x19b3a4&&(this[_0x4f9b('0x34')](_0x38b176,_0x38b176[_0x4f9b('0x39')]+_0x19b3a4,!0x1),!0x0);}[_0x4f9b('0x8')](_0x7a6feb){const _0x3ec344=this['_sidebarItemViewToAnnotation'][_0x4f9b('0x0')](_0x7a6feb);if(!_0x3ec344||!_0x3ec344[_0x4f9b('0x4')]||!_0x3ec344[_0x4f9b('0x36')])return;const _0x5e5ffe=this['_getTargetTop'](_0x3ec344,_0x3ec344[_0x4f9b('0x36')]);this['_setItemTop'](_0x7a6feb,_0x5e5ffe);}['_getTargetTop'](_0x5d2a34,_0x58b338){if(null===_0x58b338)return 0x0;if(_0x5d2a34[_0x4f9b('0x4')]instanceof _0x1e0c47)return _0x58b338['top'];{const _0x5c4ea6=new _0x1e0c47(this[_0x4f9b('0x1a')][_0x4f9b('0x2c')])[_0x4f9b('0x39')];return _0x58b338[_0x4f9b('0x39')]-_0x5c4ea6;}}[_0x4f9b('0x34')](_0x3a69b0,_0xcb0f71,_0x3f3a31=this[_0x4f9b('0x42')][_0x4f9b('0x7')][_0x4f9b('0x0')]('sidebar.preventScrollOutOfView')){_0x3f3a31&&(_0xcb0f71=Math[_0x4f9b('0x14')](_0xcb0f71,this[_0x4f9b('0x10')](_0x3a69b0))),_0x3a69b0[_0x4f9b('0x39')]=_0xcb0f71;}['_getMaxAvailableTop'](_0x37c800){let _0x5ccb58=this['_getItemBefore'](_0x37c800),_0x1fb74c=0x0;for(;_0x5ccb58;)_0x5ccb58[_0x4f9b('0x16')](),_0x1fb74c+=this[_0x4f9b('0x41')]+_0x5ccb58[_0x4f9b('0xe')],_0x5ccb58=this[_0x4f9b('0x3c')](_0x5ccb58);return _0x1fb74c;}}function H(_0x2ed72c,_0x52fe30){return Math[_0x4f9b('0x14')](_0x2ed72c-_0x52fe30,0x0);}function y(_0x5c29a8){return null!==_0x5c29a8&&_0x4f9b('0xc')==typeof _0x5c29a8&&0x1===_0x5c29a8[_0x4f9b('0x3')];}
|
|
@@ -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';
|
|
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
|
|
23
|
+
const _0x25bf=['children','ck-annotation-counter','ck-annotation-counter__badge','add','toString','annotationType','...','number','counterView','bindTemplate','bind','_badge','icon','extendTemplate','isDirty','set','setTemplate'];(function(_0xb67ce5,_0x25bf2f){const _0x559d1f=function(_0x5038d4){while(--_0x5038d4){_0xb67ce5['push'](_0xb67ce5['shift']());}};_0x559d1f(++_0x25bf2f);}(_0x25bf,0x93));const _0x559d=function(_0xb67ce5,_0x25bf2f){_0xb67ce5=_0xb67ce5-0x0;let _0x559d1f=_0x25bf[_0xb67ce5];return _0x559d1f;};import{ButtonView as _0x2367d3,View as _0x40fcf5}from'ckeditor5/src/ui';import _0x4f02d5 from'../../../theme/icons/add-comment.svg';export default class D extends _0x2367d3{constructor(_0x41741e){super(_0x41741e);const _0x349384=this[_0x559d('0xf')];this[_0x559d('0x4')](_0x559d('0x3'),!0x1),this[_0x559d('0x4')](_0x559d('0xd'),0x0),this[_0x559d('0x10')](_0x559d('0x0'))['to'](this,'isDirty',this,_0x559d('0xd'),(_0x553606,_0x49ac8c)=>_0x553606?_0x559d('0xc'):_0x49ac8c[_0x559d('0xa')]()),this[_0x559d('0x4')](_0x559d('0xb'),''),this[_0x559d('0x1')]=_0x4f02d5,this[_0x559d('0x2')]({'attributes':{'class':[_0x559d('0x7')]}}),this['counterView']=new _0x40fcf5(),this[_0x559d('0xe')][_0x559d('0x5')]({'tag':'span','attributes':{'class':[_0x559d('0x8'),_0x349384['to'](_0x559d('0xb'),_0x31b8c8=>'ck-annotation-counter__badge--'+_0x31b8c8),_0x349384['if'](_0x559d('0x3'),'ck-annotation-counter__badge--edit-mode')]},'children':[{'text':_0x349384['to'](_0x559d('0x0'))}]}),this[_0x559d('0x6')][_0x559d('0x9')](this[_0x559d('0xe')]);}}
|
|
@@ -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';
|
|
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
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4cfc=['targetRect','_mutationObserver','isActive','detach','element','listenTo','_updateHeight','ck-annotation-wrapper','keystrokes','ck-annotation-wrapper--active','clear','type','focusTracker','div','content','clientHeight','height','length','render','focus','set','mainView','isDirty','bindTemplate','destroy','ck-rounded-corners','add','Esc'];(function(_0x539484,_0x4cfcfa){const _0x2c4e5d=function(_0x3330a2){while(--_0x3330a2){_0x539484['push'](_0x539484['shift']());}};_0x2c4e5d(++_0x4cfcfa);}(_0x4cfc,0x1c3));const _0x2c4e=function(_0x539484,_0x4cfcfa){_0x539484=_0x539484-0x0;let _0x2c4e5d=_0x4cfc[_0x539484];return _0x2c4e5d;};import{View as _0x646bcc}from'ckeditor5/src/ui';import{FocusTracker as _0x40adf4,KeystrokeHandler as _0x3229c5,uid as _0x127ea5}from'ckeditor5/src/utils';import _0x390461 from'../../utils/createmutationobserver';import'../../../theme/annotation.css';export default class V extends _0x646bcc{constructor(_0x4cd026,_0x6f0b65){super(_0x4cd026),this['id']=_0x127ea5(),this['focusTracker']=new _0x40adf4(),this[_0x2c4e('0x5')]=new _0x3229c5(),this['keystrokes'][_0x2c4e('0x11')](_0x2c4e('0x18'),(_0x43aeee,_0x10a1ee)=>this['fire']('Esc',_0x10a1ee)),this['set'](_0x2c4e('0x19'),{'top':0x0,'right':0x0,'bottom':0x0,'left':0x0}),this['set'](_0x2c4e('0xd'),0x0),this[_0x2c4e('0x11')](_0x2c4e('0x1b'),!0x1),this['set'](_0x2c4e('0x13'),!0x1),this[_0x2c4e('0x11')](_0x2c4e('0xe'),0x0),this[_0x2c4e('0x11')](_0x2c4e('0x8'),''),this[_0x2c4e('0x1a')]=_0x390461(()=>this[_0x2c4e('0x3')]()),this[_0x2c4e('0xb')]=this['createCollection'](),this[_0x2c4e('0xb')][_0x2c4e('0x17')](_0x6f0b65),this[_0x2c4e('0x12')]=_0x6f0b65;const _0x34dbeb=this[_0x2c4e('0x14')];this['setTemplate']({'tag':_0x2c4e('0xa'),'attributes':{'class':['ck',_0x2c4e('0x4'),_0x2c4e('0x16'),_0x34dbeb['if'](_0x2c4e('0x1b'),_0x2c4e('0x6'))],'tabindex':-0x1},'children':this[_0x2c4e('0xb')]});}['render'](){super[_0x2c4e('0xf')](),this['focusTracker'][_0x2c4e('0x17')](this[_0x2c4e('0x1')]),this['keystrokes'][_0x2c4e('0x2')](this[_0x2c4e('0x1')]),this[_0x2c4e('0x1a')]['attach'](this[_0x2c4e('0x1')]);}['destroy'](){this[_0x2c4e('0xb')][_0x2c4e('0x7')](),this[_0x2c4e('0x5')][_0x2c4e('0x15')](),this[_0x2c4e('0x9')]['destroy'](),this[_0x2c4e('0x1a')][_0x2c4e('0x0')](),super[_0x2c4e('0x15')]();}[_0x2c4e('0x10')](){this[_0x2c4e('0x1')]['focus']();}[_0x2c4e('0x3')](){const _0x19df2e=this[_0x2c4e('0x1')][_0x2c4e('0xc')];_0x19df2e&&(this[_0x2c4e('0xd')]=_0x19df2e);}}
|