@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
package/src/commentsonly.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/commentsonly
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
6
|
-
import CommentsEditing from './comments/commentsediting';
|
|
7
|
-
/**
|
|
8
|
-
* The `CommentsOnly` plugin allows you to put the editor in a mode where a user can only add, edit or delete comments.
|
|
9
|
-
*
|
|
10
|
-
* Check the {@glink features/collaboration/comments/comments-only-mode Comments-only mode} guide to learn how to use this plugin.
|
|
11
|
-
*/
|
|
12
|
-
export default class CommentsOnly extends Plugin {
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
static get pluginName(): "CommentsOnly";
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
static get requires(): readonly [typeof CommentsEditing];
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
constructor(editor: Editor);
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
afterInit(): void;
|
|
29
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/commentsonly
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
6
|
+
import CommentsEditing from './comments/commentsediting.js';
|
|
7
|
+
/**
|
|
8
|
+
* The `CommentsOnly` plugin allows you to put the editor in a mode where a user can only add, edit or delete comments.
|
|
9
|
+
*
|
|
10
|
+
* Check the {@glink features/collaboration/comments/comments-only-mode Comments-only mode} guide to learn how to use this plugin.
|
|
11
|
+
*/
|
|
12
|
+
export default class CommentsOnly extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get pluginName(): "CommentsOnly";
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get requires(): readonly [typeof CommentsEditing];
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
constructor(editor: Editor);
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
afterInit(): void;
|
|
29
|
+
}
|
package/src/commentsonly.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2168=['clearForceDisabled','get','commentsOnly','commands','cut','listenTo','has','config','view','forceDisabled','DragDrop','document','afterInit','commentsOnlyMode','highest','_enableCommentsOnlyMode','plugins','_disableCommentsOnlyMode','editor','delete','requires','set','isEnabled','editing','stopListening','pluginName','addCommentThread','affectsData','stop'];(function(_0x3dc518,_0x2168a4){const _0x3a6e9e=function(_0x689bf2){while(--_0x689bf2){_0x3dc518['push'](_0x3dc518['shift']());}};_0x3a6e9e(++_0x2168a4);}(_0x2168,0x167));const _0x3a6e=function(_0x3dc518,_0x2168a4){_0x3dc518=_0x3dc518-0x0;let _0x3a6e9e=_0x2168[_0x3dc518];return _0x3a6e9e;};import{Plugin as _0xc8e170}from'ckeditor5/src/core.js';import _0x1e27ee from'./comments/commentsediting.js';export default class e extends _0xc8e170{static get[_0x3a6e('0xe')](){return'CommentsOnly';}static get[_0x3a6e('0x9')](){return[_0x1e27ee];}constructor(_0x3d8e86){super(_0x3d8e86),this[_0x3a6e('0xa')](_0x3a6e('0xb'),!0x1),this['on']('change:isEnabled',(_0x162f63,_0x41b419,_0x3f2cd5)=>{_0x3f2cd5?this[_0x3a6e('0x4')]():this[_0x3a6e('0x6')]();});}[_0x3a6e('0x1')](){!this[_0x3a6e('0xb')]&&this[_0x3a6e('0x7')][_0x3a6e('0x19')][_0x3a6e('0x13')](_0x3a6e('0x14'))&&(this[_0x3a6e('0xb')]=!0x0);}[_0x3a6e('0x4')](){for(const [_0x1f2728,_0x5d37ee]of this['editor'][_0x3a6e('0x15')])_0x5d37ee[_0x3a6e('0x10')]&&_0x3a6e('0xf')!==_0x1f2728&&_0x5d37ee[_0x3a6e('0x1b')](_0x3a6e('0x2'));this[_0x3a6e('0x7')][_0x3a6e('0x5')][_0x3a6e('0x18')](_0x3a6e('0x1c'))&&this[_0x3a6e('0x7')][_0x3a6e('0x5')]['get']('DragDrop')[_0x3a6e('0x1b')]('commentsOnlyMode');const _0x2fd749=this['editor'][_0x3a6e('0xc')]['view'][_0x3a6e('0x0')];this['listenTo'](_0x2fd749,_0x3a6e('0x16'),_0x3f2df0=>_0x3f2df0[_0x3a6e('0x11')](),{'priority':_0x3a6e('0x3')}),this['listenTo'](_0x2fd749,'clipboardInput',_0x3ea680=>_0x3ea680[_0x3a6e('0x11')](),{'priority':_0x3a6e('0x3')}),this[_0x3a6e('0x17')](_0x2fd749,_0x3a6e('0x8'),_0x3184c=>_0x3184c[_0x3a6e('0x11')](),{'priority':_0x3a6e('0x3')});}[_0x3a6e('0x6')](){for(const [_0x397296,_0x187f31]of this[_0x3a6e('0x7')][_0x3a6e('0x15')])_0x187f31[_0x3a6e('0x10')]&&_0x3a6e('0xf')!==_0x397296&&_0x187f31[_0x3a6e('0x12')](_0x3a6e('0x2'));this[_0x3a6e('0xd')](this[_0x3a6e('0x7')][_0x3a6e('0xc')][_0x3a6e('0x1a')][_0x3a6e('0x0')]);}}
|
package/src/config.d.ts
CHANGED
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/config
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import type { EditorConfig } from 'ckeditor5/src/core';
|
|
6
|
-
import type CommentView from './comments/ui/view/commentview';
|
|
7
|
-
import type BaseCommentThreadView from './comments/ui/view/basecommentthreadview';
|
|
8
|
-
/**
|
|
9
|
-
* The configuration of the comments feature.
|
|
10
|
-
*
|
|
11
|
-
* ```ts
|
|
12
|
-
* ClassicEditor.create( {
|
|
13
|
-
* comments: ... // Comments feature configuration.
|
|
14
|
-
* } )
|
|
15
|
-
* .then( ... )
|
|
16
|
-
* .catch( ... );
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
20
|
-
*/
|
|
21
|
-
export interface CommentsConfig {
|
|
22
|
-
/**
|
|
23
|
-
* The total number of comments shown when the thread view is collapsed.
|
|
24
|
-
*
|
|
25
|
-
* The comments are displayed in the following way:
|
|
26
|
-
*
|
|
27
|
-
* * The first comment is displayed.
|
|
28
|
-
* * Some comments may be hidden (collapsed).
|
|
29
|
-
* * An appropriate number of the most recent comments is displayed.
|
|
30
|
-
*
|
|
31
|
-
* For example, when this parameter is set to 3, when collapsed,
|
|
32
|
-
* the thread view will display the first comment and two most recent comments.
|
|
33
|
-
*
|
|
34
|
-
* Defaults to `2`.
|
|
35
|
-
*/
|
|
36
|
-
maxCommentsWhenCollapsed?: number;
|
|
37
|
-
/**
|
|
38
|
-
* The maximum total weight of a thread before the thread becomes collapsed when it is not active:
|
|
39
|
-
*
|
|
40
|
-
* * Thread weight is a sum of the weight of its comments.
|
|
41
|
-
* * Comment weight is equal to the comment length.
|
|
42
|
-
* * The minimal comment weight is 200.
|
|
43
|
-
*
|
|
44
|
-
* Defaults to `500`.
|
|
45
|
-
*/
|
|
46
|
-
maxThreadTotalWeight?: number;
|
|
47
|
-
/**
|
|
48
|
-
* The maximum number of characters displayed in a comment when the thread view is collapsed.
|
|
49
|
-
* Longer comments will be trimmed.
|
|
50
|
-
*
|
|
51
|
-
* Defaults to `140`.
|
|
52
|
-
*/
|
|
53
|
-
maxCommentCharsWhenCollapsed?: number;
|
|
54
|
-
/**
|
|
55
|
-
* A view class to be used to create comment views.
|
|
56
|
-
*
|
|
57
|
-
* {@link module:comments/comments/ui/view/commentview~CommentView} is used by default when this property is not set.
|
|
58
|
-
*/
|
|
59
|
-
CommentView?: typeof CommentView;
|
|
60
|
-
/**
|
|
61
|
-
* A view class to be used to create comment thread views
|
|
62
|
-
* (used as annotations - in sidebar balloons or in inline annotations).
|
|
63
|
-
*
|
|
64
|
-
* {@link module:comments/comments/ui/view/commentthreadview~CommentThreadView} is used by default
|
|
65
|
-
* when this property is not set.
|
|
66
|
-
*/
|
|
67
|
-
CommentThreadView?: typeof BaseCommentThreadView;
|
|
68
|
-
/**
|
|
69
|
-
* Configuration for the comments editor.
|
|
70
|
-
*
|
|
71
|
-
* By using this property, you can customize the editor instance used in the comments
|
|
72
|
-
* reply field (e.g. by adding plugins or changing features configuration).
|
|
73
|
-
*
|
|
74
|
-
* To use the default configuration (allows only for text input, no formatting), you can pass `{}`
|
|
75
|
-
* to the comments editor configuration.
|
|
76
|
-
*
|
|
77
|
-
* ```ts
|
|
78
|
-
* ClassicEditor.create( element, {
|
|
79
|
-
* comments: {
|
|
80
|
-
* editorConfig: {}
|
|
81
|
-
* }
|
|
82
|
-
* } );
|
|
83
|
-
* ```
|
|
84
|
-
*
|
|
85
|
-
* To provide a better experience, you may add more plugins, that will extend the default editor configuration.
|
|
86
|
-
*
|
|
87
|
-
* ```ts
|
|
88
|
-
* import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat';
|
|
89
|
-
* import List from '@ckeditor/ckeditor5-list/src/list';
|
|
90
|
-
* import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
|
|
91
|
-
* import Italic from '@ckeditor/ckeditor5-italic/src/italic';
|
|
92
|
-
*
|
|
93
|
-
* ClassicEditor
|
|
94
|
-
* .create( {
|
|
95
|
-
* comments: {
|
|
96
|
-
* editorConfig: {
|
|
97
|
-
* extraPlugins: [ Autoformat, Bold, Italic, List ]
|
|
98
|
-
* }
|
|
99
|
-
* }
|
|
100
|
-
* } )
|
|
101
|
-
* ```
|
|
102
|
-
*
|
|
103
|
-
* Importing plugins may not be possible in some scenarios (e.g. when using a build created by the online builder tool).
|
|
104
|
-
* In that case, it is possible to get the plugin constructors from the editor builtin plugins.
|
|
105
|
-
*
|
|
106
|
-
* ```ts
|
|
107
|
-
* const extraCommentsPlugins = ClassicEditor.builtinPlugins.filter( plugin => {
|
|
108
|
-
* return [ 'Bold', 'Italic', Autoformat, List ].includes( plugin.pluginName );
|
|
109
|
-
* } );
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* ClassicEditor
|
|
113
|
-
* .create( {
|
|
114
|
-
* comments: {
|
|
115
|
-
* editorConfig: {
|
|
116
|
-
* extraPlugins: extraCommentsPlugins
|
|
117
|
-
* }
|
|
118
|
-
* }
|
|
119
|
-
* } )
|
|
120
|
-
* .then( ... )
|
|
121
|
-
* .catch( ... );
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
editorConfig?: EditorConfig;
|
|
125
|
-
/**
|
|
126
|
-
* A function that takes a `Date` object, formats it to a desired string and returns it.
|
|
127
|
-
* It should be used when displaying the comment creation date.
|
|
128
|
-
*/
|
|
129
|
-
formatDateTime?: (date: Date) => string;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* The configuration of the sidebar feature.
|
|
133
|
-
*
|
|
134
|
-
* ```ts
|
|
135
|
-
* ClassicEditor
|
|
136
|
-
* .create( {
|
|
137
|
-
* sidebar: {
|
|
138
|
-
* // Sidebar feature configuration.
|
|
139
|
-
* }
|
|
140
|
-
* } )
|
|
141
|
-
* .then( ... )
|
|
142
|
-
* .catch( ... );
|
|
143
|
-
* ```
|
|
144
|
-
*
|
|
145
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
|
|
146
|
-
*/
|
|
147
|
-
export interface SidebarConfig {
|
|
148
|
-
/**
|
|
149
|
-
* DOM element into which the sidebar will be inserted.
|
|
150
|
-
*/
|
|
151
|
-
container?: HTMLElement;
|
|
152
|
-
/**
|
|
153
|
-
* Changes how the annotations are positioned inside the sidebar.
|
|
154
|
-
*
|
|
155
|
-
* If set to `true`, the top annotation in the sidebar will never be scrolled
|
|
156
|
-
* above the top edge of the sidebar (which would make it hidden).
|
|
157
|
-
*
|
|
158
|
-
* On the other hand, with this setting enabled, if there is not enough space,
|
|
159
|
-
* annotations will not be positioned exactly next to their linked elements
|
|
160
|
-
* when selected.
|
|
161
|
-
*
|
|
162
|
-
* @default false
|
|
163
|
-
*/
|
|
164
|
-
preventScrollOutOfView?: boolean;
|
|
165
|
-
}
|
|
166
|
-
export type CommentThreadConfig = Required<Omit<CommentsConfig, 'CommentThreadView'>>;
|
|
167
|
-
export type CommentViewConfig = Required<Pick<CommentsConfig, 'maxCommentCharsWhenCollapsed' | 'formatDateTime' | 'editorConfig'>> & {
|
|
168
|
-
/**
|
|
169
|
-
* Defines whether the comment is created by the system.
|
|
170
|
-
*/
|
|
171
|
-
isSystemComment?: boolean;
|
|
172
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/config
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import type { EditorConfig } from 'ckeditor5/src/core.js';
|
|
6
|
+
import type CommentView from './comments/ui/view/commentview.js';
|
|
7
|
+
import type BaseCommentThreadView from './comments/ui/view/basecommentthreadview.js';
|
|
8
|
+
/**
|
|
9
|
+
* The configuration of the comments feature.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* ClassicEditor.create( {
|
|
13
|
+
* comments: ... // Comments feature configuration.
|
|
14
|
+
* } )
|
|
15
|
+
* .then( ... )
|
|
16
|
+
* .catch( ... );
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
20
|
+
*/
|
|
21
|
+
export interface CommentsConfig {
|
|
22
|
+
/**
|
|
23
|
+
* The total number of comments shown when the thread view is collapsed.
|
|
24
|
+
*
|
|
25
|
+
* The comments are displayed in the following way:
|
|
26
|
+
*
|
|
27
|
+
* * The first comment is displayed.
|
|
28
|
+
* * Some comments may be hidden (collapsed).
|
|
29
|
+
* * An appropriate number of the most recent comments is displayed.
|
|
30
|
+
*
|
|
31
|
+
* For example, when this parameter is set to 3, when collapsed,
|
|
32
|
+
* the thread view will display the first comment and two most recent comments.
|
|
33
|
+
*
|
|
34
|
+
* Defaults to `2`.
|
|
35
|
+
*/
|
|
36
|
+
maxCommentsWhenCollapsed?: number;
|
|
37
|
+
/**
|
|
38
|
+
* The maximum total weight of a thread before the thread becomes collapsed when it is not active:
|
|
39
|
+
*
|
|
40
|
+
* * Thread weight is a sum of the weight of its comments.
|
|
41
|
+
* * Comment weight is equal to the comment length.
|
|
42
|
+
* * The minimal comment weight is 200.
|
|
43
|
+
*
|
|
44
|
+
* Defaults to `500`.
|
|
45
|
+
*/
|
|
46
|
+
maxThreadTotalWeight?: number;
|
|
47
|
+
/**
|
|
48
|
+
* The maximum number of characters displayed in a comment when the thread view is collapsed.
|
|
49
|
+
* Longer comments will be trimmed.
|
|
50
|
+
*
|
|
51
|
+
* Defaults to `140`.
|
|
52
|
+
*/
|
|
53
|
+
maxCommentCharsWhenCollapsed?: number;
|
|
54
|
+
/**
|
|
55
|
+
* A view class to be used to create comment views.
|
|
56
|
+
*
|
|
57
|
+
* {@link module:comments/comments/ui/view/commentview~CommentView} is used by default when this property is not set.
|
|
58
|
+
*/
|
|
59
|
+
CommentView?: typeof CommentView;
|
|
60
|
+
/**
|
|
61
|
+
* A view class to be used to create comment thread views
|
|
62
|
+
* (used as annotations - in sidebar balloons or in inline annotations).
|
|
63
|
+
*
|
|
64
|
+
* {@link module:comments/comments/ui/view/commentthreadview~CommentThreadView} is used by default
|
|
65
|
+
* when this property is not set.
|
|
66
|
+
*/
|
|
67
|
+
CommentThreadView?: typeof BaseCommentThreadView;
|
|
68
|
+
/**
|
|
69
|
+
* Configuration for the comments editor.
|
|
70
|
+
*
|
|
71
|
+
* By using this property, you can customize the editor instance used in the comments
|
|
72
|
+
* reply field (e.g. by adding plugins or changing features configuration).
|
|
73
|
+
*
|
|
74
|
+
* To use the default configuration (allows only for text input, no formatting), you can pass `{}`
|
|
75
|
+
* to the comments editor configuration.
|
|
76
|
+
*
|
|
77
|
+
* ```ts
|
|
78
|
+
* ClassicEditor.create( element, {
|
|
79
|
+
* comments: {
|
|
80
|
+
* editorConfig: {}
|
|
81
|
+
* }
|
|
82
|
+
* } );
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* To provide a better experience, you may add more plugins, that will extend the default editor configuration.
|
|
86
|
+
*
|
|
87
|
+
* ```ts
|
|
88
|
+
* import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat.js';
|
|
89
|
+
* import List from '@ckeditor/ckeditor5-list/src/list.js';
|
|
90
|
+
* import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold.js';
|
|
91
|
+
* import Italic from '@ckeditor/ckeditor5-italic/src/italic.js';
|
|
92
|
+
*
|
|
93
|
+
* ClassicEditor
|
|
94
|
+
* .create( {
|
|
95
|
+
* comments: {
|
|
96
|
+
* editorConfig: {
|
|
97
|
+
* extraPlugins: [ Autoformat, Bold, Italic, List ]
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
* } )
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* Importing plugins may not be possible in some scenarios (e.g. when using a build created by the online builder tool).
|
|
104
|
+
* In that case, it is possible to get the plugin constructors from the editor builtin plugins.
|
|
105
|
+
*
|
|
106
|
+
* ```ts
|
|
107
|
+
* const extraCommentsPlugins = ClassicEditor.builtinPlugins.filter( plugin => {
|
|
108
|
+
* return [ 'Bold', 'Italic', Autoformat, List ].includes( plugin.pluginName );
|
|
109
|
+
* } );
|
|
110
|
+
*
|
|
111
|
+
*
|
|
112
|
+
* ClassicEditor
|
|
113
|
+
* .create( {
|
|
114
|
+
* comments: {
|
|
115
|
+
* editorConfig: {
|
|
116
|
+
* extraPlugins: extraCommentsPlugins
|
|
117
|
+
* }
|
|
118
|
+
* }
|
|
119
|
+
* } )
|
|
120
|
+
* .then( ... )
|
|
121
|
+
* .catch( ... );
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
editorConfig?: EditorConfig;
|
|
125
|
+
/**
|
|
126
|
+
* A function that takes a `Date` object, formats it to a desired string and returns it.
|
|
127
|
+
* It should be used when displaying the comment creation date.
|
|
128
|
+
*/
|
|
129
|
+
formatDateTime?: (date: Date) => string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The configuration of the sidebar feature.
|
|
133
|
+
*
|
|
134
|
+
* ```ts
|
|
135
|
+
* ClassicEditor
|
|
136
|
+
* .create( {
|
|
137
|
+
* sidebar: {
|
|
138
|
+
* // Sidebar feature configuration.
|
|
139
|
+
* }
|
|
140
|
+
* } )
|
|
141
|
+
* .then( ... )
|
|
142
|
+
* .catch( ... );
|
|
143
|
+
* ```
|
|
144
|
+
*
|
|
145
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
|
|
146
|
+
*/
|
|
147
|
+
export interface SidebarConfig {
|
|
148
|
+
/**
|
|
149
|
+
* DOM element into which the sidebar will be inserted.
|
|
150
|
+
*/
|
|
151
|
+
container?: HTMLElement;
|
|
152
|
+
/**
|
|
153
|
+
* Changes how the annotations are positioned inside the sidebar.
|
|
154
|
+
*
|
|
155
|
+
* If set to `true`, the top annotation in the sidebar will never be scrolled
|
|
156
|
+
* above the top edge of the sidebar (which would make it hidden).
|
|
157
|
+
*
|
|
158
|
+
* On the other hand, with this setting enabled, if there is not enough space,
|
|
159
|
+
* annotations will not be positioned exactly next to their linked elements
|
|
160
|
+
* when selected.
|
|
161
|
+
*
|
|
162
|
+
* @default false
|
|
163
|
+
*/
|
|
164
|
+
preventScrollOutOfView?: boolean;
|
|
165
|
+
}
|
|
166
|
+
export type CommentThreadConfig = Required<Omit<CommentsConfig, 'CommentThreadView'>>;
|
|
167
|
+
export type CommentViewConfig = Required<Pick<CommentsConfig, 'maxCommentCharsWhenCollapsed' | 'formatDateTime' | 'editorConfig'>> & {
|
|
168
|
+
/**
|
|
169
|
+
* Defines whether the comment is created by the system.
|
|
170
|
+
*/
|
|
171
|
+
isSystemComment?: boolean;
|
|
172
|
+
};
|
package/src/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { default as Comments } from './comments';
|
|
2
|
-
export { default as CommentsOnly } from './commentsonly';
|
|
3
|
-
export { default as CommentsUI } from './comments/commentsui';
|
|
4
|
-
export { default as CommentsRepository, CommentThread, Comment } from './comments/commentsrepository';
|
|
5
|
-
export { default as CommentThreadController } from './comments/ui/commentthreadcontroller';
|
|
6
|
-
export { default as Annotations } from './annotations/annotations';
|
|
7
|
-
export { default as AnnotationsUIs } from './annotations/annotationsuis';
|
|
8
|
-
export { default as EditorAnnotations } from './annotations/editorannotations';
|
|
9
|
-
export { default as InlineAnnotations } from './annotations/inlineannotations';
|
|
10
|
-
export { default as WideSidebar } from './annotations/widesidebar';
|
|
11
|
-
export { default as NarrowSidebar } from './annotations/narrowsidebar';
|
|
12
|
-
export { default as AnnotationView } from './annotations/view/annotationview';
|
|
13
|
-
export { default as BaseCommentView } from './comments/ui/view/basecommentview';
|
|
14
|
-
export { default as BaseCommentThreadView } from './comments/ui/view/basecommentthreadview';
|
|
15
|
-
export { default as CommentsListView } from './comments/ui/view/commentslistview';
|
|
16
|
-
export { default as CommentView } from './comments/ui/view/commentview';
|
|
17
|
-
export { default as CommentThreadInputView } from './comments/ui/view/commentthreadinputview';
|
|
18
|
-
export type { CommentsConfig, SidebarConfig } from './config';
|
|
19
|
-
export type { default as CommentsEditing } from './comments/commentsediting';
|
|
20
|
-
export type { CommentDataJSON, CommentThreadContext } from './comments/commentsrepository';
|
|
21
|
-
import './augmentation';
|
|
1
|
+
export { default as Comments } from './comments.js';
|
|
2
|
+
export { default as CommentsOnly } from './commentsonly.js';
|
|
3
|
+
export { default as CommentsUI } from './comments/commentsui.js';
|
|
4
|
+
export { default as CommentsRepository, CommentThread, Comment } from './comments/commentsrepository.js';
|
|
5
|
+
export { default as CommentThreadController } from './comments/ui/commentthreadcontroller.js';
|
|
6
|
+
export { default as Annotations } from './annotations/annotations.js';
|
|
7
|
+
export { default as AnnotationsUIs } from './annotations/annotationsuis.js';
|
|
8
|
+
export { default as EditorAnnotations } from './annotations/editorannotations.js';
|
|
9
|
+
export { default as InlineAnnotations } from './annotations/inlineannotations.js';
|
|
10
|
+
export { default as WideSidebar } from './annotations/widesidebar.js';
|
|
11
|
+
export { default as NarrowSidebar } from './annotations/narrowsidebar.js';
|
|
12
|
+
export { default as AnnotationView } from './annotations/view/annotationview.js';
|
|
13
|
+
export { default as BaseCommentView } from './comments/ui/view/basecommentview.js';
|
|
14
|
+
export { default as BaseCommentThreadView } from './comments/ui/view/basecommentthreadview.js';
|
|
15
|
+
export { default as CommentsListView } from './comments/ui/view/commentslistview.js';
|
|
16
|
+
export { default as CommentView } from './comments/ui/view/commentview.js';
|
|
17
|
+
export { default as CommentThreadInputView } from './comments/ui/view/commentthreadinputview.js';
|
|
18
|
+
export type { CommentsConfig, SidebarConfig } from './config.js';
|
|
19
|
+
export type { default as CommentsEditing } from './comments/commentsediting.js';
|
|
20
|
+
export type { CommentDataJSON, CommentThreadContext } from './comments/commentsrepository.js';
|
|
21
|
+
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export{default as Comments}from'./comments';export{default as CommentsOnly}from'./commentsonly';export{default as CommentsUI}from'./comments/commentsui';export{default as CommentsRepository,CommentThread,Comment}from'./comments/commentsrepository';export{default as CommentThreadController}from'./comments/ui/commentthreadcontroller';export{default as Annotations}from'./annotations/annotations';export{default as AnnotationsUIs}from'./annotations/annotationsuis';export{default as EditorAnnotations}from'./annotations/editorannotations';export{default as InlineAnnotations}from'./annotations/inlineannotations';export{default as WideSidebar}from'./annotations/widesidebar';export{default as NarrowSidebar}from'./annotations/narrowsidebar';export{default as AnnotationView}from'./annotations/view/annotationview';export{default as BaseCommentView}from'./comments/ui/view/basecommentview';export{default as BaseCommentThreadView}from'./comments/ui/view/basecommentthreadview';export{default as CommentsListView}from'./comments/ui/view/commentslistview';export{default as CommentView}from'./comments/ui/view/commentview';export{default as CommentThreadInputView}from'./comments/ui/view/commentthreadinputview';import'./augmentation';
|
|
23
|
+
export{default as Comments}from'./comments.js';export{default as CommentsOnly}from'./commentsonly.js';export{default as CommentsUI}from'./comments/commentsui.js';export{default as CommentsRepository,CommentThread,Comment}from'./comments/commentsrepository.js';export{default as CommentThreadController}from'./comments/ui/commentthreadcontroller.js';export{default as Annotations}from'./annotations/annotations.js';export{default as AnnotationsUIs}from'./annotations/annotationsuis.js';export{default as EditorAnnotations}from'./annotations/editorannotations.js';export{default as InlineAnnotations}from'./annotations/inlineannotations.js';export{default as WideSidebar}from'./annotations/widesidebar.js';export{default as NarrowSidebar}from'./annotations/narrowsidebar.js';export{default as AnnotationView}from'./annotations/view/annotationview.js';export{default as BaseCommentView}from'./comments/ui/view/basecommentview.js';export{default as BaseCommentThreadView}from'./comments/ui/view/basecommentthreadview.js';export{default as CommentsListView}from'./comments/ui/view/commentslistview.js';export{default as CommentView}from'./comments/ui/view/commentview.js';export{default as CommentThreadInputView}from'./comments/ui/view/commentthreadinputview.js';import'./augmentation.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/utils/common-translations
|
|
3
|
-
*/
|
|
4
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
5
|
-
export declare function getTranslation(locale: Locale, id: string, values?: string | Array<string> | number): string;
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/utils/common-translations
|
|
3
|
+
*/
|
|
4
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
5
|
+
export declare function getTranslation(locale: Locale, id: string, values?: string | Array<string> | number): string;
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export function getTranslation(
|
|
23
|
+
export function getTranslation(_0x3565df,_0x13bb13,_0x3d24bd){const t=_0x3565df['t'];switch(_0x13bb13){case'PENDING_ACTION_COMMENT_THREAD':return t({'string':'Unsaved\x20change\x20in\x20comment\x20thread.','id':'PENDING_ACTION_COMMENT_THREAD'});case'Comment':return t('Comment');case'Reply...':return t('Reply...');case'Reply\x20to\x20reopen\x20discussion...':return t('Reply\x20to\x20reopen\x20discussion...');case'Write\x20a\x20comment...':return t('Write\x20a\x20comment...');case'Comment\x20was\x20made\x20on\x20an\x20element':return t('Comment\x20was\x20made\x20on\x20an\x20element');case'Comment\x20editor':return t('Comment\x20editor');case'Delete\x20comment\x20thread?':return t('Delete\x20comment\x20thread?');case'Delete\x20comment?':return t('Delete\x20comment?');case'Marked\x20as\x20resolved':return t('Marked\x20as\x20resolved');case'Show\x20more\x20items':return t('Show\x20more\x20items');case'Cancel':return t('Cancel');case'Edit':return t('Edit');case'Resolve':return t('Resolve');case'Reopen':return t('Reopen');case'Remove':return t('Remove');case'Reply':return t('Reply');case'Save':return t('Save');case'NUMBER_OF_COMMENTS':return t({'string':'%0\x20Comment','plural':'%0\x20Comments','id':'NUMBER_OF_COMMENTS'},_0x3d24bd);case'TOO_LONG_COMMENT_ALERT':return t({'string':'Comment\x20content\x20is\x20too\x20long.\x20Your\x20comment\x20has\x20%0\x20characters\x20but\x20the\x20limit\x20is\x20%1\x20characters.','id':'TOO_LONG_COMMENT_ALERT'},_0x3d24bd);case'EXTERNAL_COMMENT':return t({'string':'This\x20comment\x20comes\x20from\x20an\x20external\x20source.','id':'EXTERNAL_COMMENT'});case'EXTERNAL_IMPORT_WORD_COMMENT':return t({'string':'This\x20comment\x20comes\x20from\x20an\x20imported\x20Word\x20file.','id':'EXTERNAL_IMPORT_WORD_COMMENT'});case'EXTERNAL_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20external\x20source\x20(added\x20by\x20%0)','id':'EXTERNAL_AVATAR'},_0x3d24bd);case'EXTERNAL_IMPORT_WORD_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20a\x20Word\x20document\x20imported\x20by\x20%0','id':'EXTERNAL_IMPORT_WORD_AVATAR'},_0x3d24bd);case'COMMENTS_ARCHIVE':return t({'string':'Comments\x20archive','id':'COMMENTS_ARCHIVE'});case'EMPTY_COMMENTS_ARCHIVE':return t({'string':'There\x20are\x20no\x20archived\x20comment\x20threads.','id':'EMPTY_COMMENTS_ARCHIVE'});default:return'';}}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/annotations/createmutationobserver
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Creates mutation observer to observe changes that might cause height change.
|
|
6
|
-
*
|
|
7
|
-
* @param callback Callback executed after throttled mutations.
|
|
8
|
-
*/
|
|
9
|
-
export default function createMutationObserver(callback: (...args: Array<any>) => unknown): MutationObserver;
|
|
10
|
-
export interface MutationObserver {
|
|
11
|
-
attach: (element: Node) => void;
|
|
12
|
-
detach: () => void;
|
|
13
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/annotations/createmutationobserver
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Creates mutation observer to observe changes that might cause height change.
|
|
6
|
+
*
|
|
7
|
+
* @param callback Callback executed after throttled mutations.
|
|
8
|
+
*/
|
|
9
|
+
export default function createMutationObserver(callback: (...args: Array<any>) => unknown): MutationObserver;
|
|
10
|
+
export interface MutationObserver {
|
|
11
|
+
attach: (element: Node) => void;
|
|
12
|
+
detach: () => void;
|
|
13
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x574f=['attributeName','type','cancel','disconnect','characterData','class','observe','attributes'];(function(_0x524b9a,_0x574fe1){const _0x3b337c=function(_0x58cd57){while(--_0x58cd57){_0x524b9a['push'](_0x524b9a['shift']());}};_0x3b337c(++_0x574fe1);}(_0x574f,0x1be));const _0x3b33=function(_0x524b9a,_0x574fe1){_0x524b9a=_0x524b9a-0x0;let _0x3b337c=_0x574f[_0x524b9a];return _0x3b337c;};import{throttle as _0x50d210}from'lodash-es';export default function Dt(_0x38e845){const _0x4bfdfb=_0x50d210(_0x38e845,0x1e),_0x25709=new MutationObserver(_0x598110=>{for(const _0x250970 of _0x598110)(_0x3b33('0x1')==_0x250970[_0x3b33('0x3')]&&_0x3b33('0x7')==_0x250970[_0x3b33('0x2')]||'childList'==_0x250970[_0x3b33('0x3')]||_0x3b33('0x6')==_0x250970[_0x3b33('0x3')])&&_0x4bfdfb();});return{'attach'(_0x24fad1){_0x25709[_0x3b33('0x0')](_0x24fad1,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0x25709[_0x3b33('0x5')](),_0x4bfdfb[_0x3b33('0x4')]();}};}
|