@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.
Files changed (85) hide show
  1. package/build/comments.js +1 -1
  2. package/package.json +3 -3
  3. package/src/annotations/annotation.d.ts +86 -86
  4. package/src/annotations/annotation.js +1 -1
  5. package/src/annotations/annotationcollection.d.ts +94 -94
  6. package/src/annotations/annotationcollection.js +1 -1
  7. package/src/annotations/annotations.d.ts +150 -150
  8. package/src/annotations/annotations.js +1 -1
  9. package/src/annotations/annotationsuis.d.ts +228 -228
  10. package/src/annotations/annotationsuis.js +1 -1
  11. package/src/annotations/editorannotations.d.ts +63 -63
  12. package/src/annotations/editorannotations.js +1 -1
  13. package/src/annotations/inlineannotations.d.ts +86 -86
  14. package/src/annotations/inlineannotations.js +1 -1
  15. package/src/annotations/narrowsidebar.d.ts +81 -81
  16. package/src/annotations/narrowsidebar.js +1 -1
  17. package/src/annotations/sidebar.d.ts +96 -96
  18. package/src/annotations/sidebar.js +1 -1
  19. package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -25
  20. package/src/annotations/view/annotationcounterbuttonview.js +1 -1
  21. package/src/annotations/view/annotationview.d.ts +86 -86
  22. package/src/annotations/view/annotationview.js +1 -1
  23. package/src/annotations/view/sidebaritemview.d.ts +51 -51
  24. package/src/annotations/view/sidebaritemview.js +1 -1
  25. package/src/annotations/view/sidebarview.d.ts +28 -28
  26. package/src/annotations/view/sidebarview.js +1 -1
  27. package/src/annotations/widesidebar.d.ts +73 -73
  28. package/src/annotations/widesidebar.js +1 -1
  29. package/src/augmentation.d.ts +48 -48
  30. package/src/comments/addcommentthreadcommand.d.ts +31 -31
  31. package/src/comments/addcommentthreadcommand.js +1 -1
  32. package/src/comments/commentsarchive.d.ts +27 -27
  33. package/src/comments/commentsarchive.js +1 -1
  34. package/src/comments/commentsarchiveui.d.ts +34 -34
  35. package/src/comments/commentsarchiveui.js +1 -1
  36. package/src/comments/commentsediting.d.ts +75 -75
  37. package/src/comments/commentsediting.js +1 -1
  38. package/src/comments/commentsrepository.d.ts +1088 -1088
  39. package/src/comments/commentsrepository.js +1 -1
  40. package/src/comments/commentsui.d.ts +29 -29
  41. package/src/comments/commentsui.js +1 -1
  42. package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -13
  43. package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
  44. package/src/comments/integrations/importword.d.ts +17 -17
  45. package/src/comments/integrations/importword.js +1 -1
  46. package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -32
  47. package/src/comments/ui/commenteditor/commenteditor.js +1 -1
  48. package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -27
  49. package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
  50. package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -32
  51. package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
  52. package/src/comments/ui/commentthreadcontroller.d.ts +64 -64
  53. package/src/comments/ui/commentthreadcontroller.js +1 -1
  54. package/src/comments/ui/view/basecommentthreadview.d.ts +108 -108
  55. package/src/comments/ui/view/basecommentthreadview.js +1 -1
  56. package/src/comments/ui/view/basecommentview.d.ts +108 -108
  57. package/src/comments/ui/view/basecommentview.js +1 -1
  58. package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -9
  59. package/src/comments/ui/view/collapsedcommentsview.js +1 -1
  60. package/src/comments/ui/view/commentcontentview.d.ts +10 -10
  61. package/src/comments/ui/view/commentcontentview.js +1 -1
  62. package/src/comments/ui/view/commentinputview.d.ts +82 -82
  63. package/src/comments/ui/view/commentinputview.js +1 -1
  64. package/src/comments/ui/view/commentsarchiveview.d.ts +34 -34
  65. package/src/comments/ui/view/commentsarchiveview.js +1 -1
  66. package/src/comments/ui/view/commentslistview.d.ts +96 -96
  67. package/src/comments/ui/view/commentslistview.js +1 -1
  68. package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -46
  69. package/src/comments/ui/view/commentthreadheaderview.js +1 -1
  70. package/src/comments/ui/view/commentthreadinputview.d.ts +37 -37
  71. package/src/comments/ui/view/commentthreadinputview.js +1 -1
  72. package/src/comments/ui/view/commentthreadview.d.ts +113 -113
  73. package/src/comments/ui/view/commentthreadview.js +1 -1
  74. package/src/comments/ui/view/commentview.d.ts +239 -239
  75. package/src/comments/ui/view/commentview.js +1 -1
  76. package/src/comments.d.ts +31 -31
  77. package/src/comments.js +1 -1
  78. package/src/commentsonly.d.ts +29 -29
  79. package/src/commentsonly.js +1 -1
  80. package/src/config.d.ts +172 -172
  81. package/src/index.d.ts +21 -21
  82. package/src/utils/common-translations.d.ts +5 -5
  83. package/src/utils/common-translations.js +1 -1
  84. package/src/utils/createmutationobserver.d.ts +13 -13
  85. package/src/utils/createmutationobserver.js +1 -1
@@ -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';
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
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x498e=['CommentsOnly','isEnabled','get','editing','requires','afterInit','addCommentThread','config','document','commands','DragDrop','commentsOnlyMode','affectsData','change:isEnabled','stop','clipboardInput','stopListening','plugins','highest','editor','listenTo','_enableCommentsOnlyMode','view','forceDisabled','_disableCommentsOnlyMode','delete'];(function(_0x95da8d,_0x498e0f){const _0x11f650=function(_0x254459){while(--_0x254459){_0x95da8d['push'](_0x95da8d['shift']());}};_0x11f650(++_0x498e0f);}(_0x498e,0x8b));const _0x11f6=function(_0x95da8d,_0x498e0f){_0x95da8d=_0x95da8d-0x0;let _0x11f650=_0x498e[_0x95da8d];return _0x11f650;};import{Plugin as _0x35cf9d}from'ckeditor5/src/core';import _0x447cee from'./comments/commentsediting';export default class n extends _0x35cf9d{static get['pluginName'](){return _0x11f6('0x11');}static get[_0x11f6('0x15')](){return[_0x447cee];}constructor(_0x473402){super(_0x473402),this['set'](_0x11f6('0x12'),!0x1),this['on'](_0x11f6('0x4'),(_0x69acd9,_0x3ca0b2,_0x3771ba)=>{_0x3771ba?this[_0x11f6('0xc')]():this[_0x11f6('0xf')]();});}[_0x11f6('0x16')](){!this['isEnabled']&&this['editor'][_0x11f6('0x18')][_0x11f6('0x13')]('commentsOnly')&&(this[_0x11f6('0x12')]=!0x0);}[_0x11f6('0xc')](){for(const [_0x5ef8be,_0x45da19]of this['editor'][_0x11f6('0x0')])_0x45da19[_0x11f6('0x3')]&&_0x11f6('0x17')!==_0x5ef8be&&_0x45da19[_0x11f6('0xe')]('commentsOnlyMode');this['editor'][_0x11f6('0x8')]['has'](_0x11f6('0x1'))&&this[_0x11f6('0xa')]['plugins'][_0x11f6('0x13')](_0x11f6('0x1'))[_0x11f6('0xe')](_0x11f6('0x2'));const _0x3ca2ea=this[_0x11f6('0xa')]['editing'][_0x11f6('0xd')][_0x11f6('0x19')];this[_0x11f6('0xb')](_0x3ca2ea,'cut',_0x26554e=>_0x26554e['stop'](),{'priority':'highest'}),this[_0x11f6('0xb')](_0x3ca2ea,_0x11f6('0x6'),_0x5876d2=>_0x5876d2[_0x11f6('0x5')](),{'priority':'highest'}),this[_0x11f6('0xb')](_0x3ca2ea,_0x11f6('0x10'),_0x19f268=>_0x19f268[_0x11f6('0x5')](),{'priority':_0x11f6('0x9')});}[_0x11f6('0xf')](){for(const [_0x396cc2,_0x3d37d2]of this[_0x11f6('0xa')][_0x11f6('0x0')])_0x3d37d2[_0x11f6('0x3')]&&'addCommentThread'!==_0x396cc2&&_0x3d37d2['clearForceDisabled'](_0x11f6('0x2'));this[_0x11f6('0x7')](this[_0x11f6('0xa')][_0x11f6('0x14')][_0x11f6('0xd')]['document']);}}
23
+ const _0x298b=['addCommentThread','listenTo','cut','_enableCommentsOnlyMode','change:isEnabled','forceDisabled','commentsOnlyMode','stopListening','editing','config','get','document','_disableCommentsOnlyMode','has','commands','plugins','commentsOnly','editor','set','view','clipboardInput','affectsData','requires','highest','isEnabled','pluginName','DragDrop','delete'];(function(_0x30234a,_0x298bbb){const _0x182a24=function(_0x493d7d){while(--_0x493d7d){_0x30234a['push'](_0x30234a['shift']());}};_0x182a24(++_0x298bbb);}(_0x298b,0x12e));const _0x182a=function(_0x30234a,_0x298bbb){_0x30234a=_0x30234a-0x0;let _0x182a24=_0x298b[_0x30234a];return _0x182a24;};import{Plugin as _0x117b9d}from'ckeditor5/src/core';import _0x38742b from'./comments/commentsediting';export default class n extends _0x117b9d{static get[_0x182a('0x3')](){return'CommentsOnly';}static get[_0x182a('0x0')](){return[_0x38742b];}constructor(_0x3b715c){super(_0x3b715c),this[_0x182a('0x18')](_0x182a('0x2'),!0x1),this['on'](_0x182a('0xa'),(_0x5bd285,_0xc26713,_0xa7c496)=>{_0xa7c496?this[_0x182a('0x9')]():this[_0x182a('0x12')]();});}['afterInit'](){!this['isEnabled']&&this[_0x182a('0x17')][_0x182a('0xf')][_0x182a('0x10')](_0x182a('0x16'))&&(this['isEnabled']=!0x0);}['_enableCommentsOnlyMode'](){for(const [_0x11a56e,_0x2d63c3]of this[_0x182a('0x17')][_0x182a('0x14')])_0x2d63c3['affectsData']&&_0x182a('0x6')!==_0x11a56e&&_0x2d63c3[_0x182a('0xb')](_0x182a('0xc'));this[_0x182a('0x17')][_0x182a('0x15')][_0x182a('0x13')](_0x182a('0x4'))&&this[_0x182a('0x17')]['plugins'][_0x182a('0x10')](_0x182a('0x4'))[_0x182a('0xb')](_0x182a('0xc'));const _0x47c768=this['editor'][_0x182a('0xe')][_0x182a('0x19')][_0x182a('0x11')];this['listenTo'](_0x47c768,_0x182a('0x8'),_0x2f405a=>_0x2f405a['stop'](),{'priority':_0x182a('0x1')}),this[_0x182a('0x7')](_0x47c768,_0x182a('0x1a'),_0x26c5a2=>_0x26c5a2['stop'](),{'priority':_0x182a('0x1')}),this[_0x182a('0x7')](_0x47c768,_0x182a('0x5'),_0x5c8180=>_0x5c8180['stop'](),{'priority':'highest'});}[_0x182a('0x12')](){for(const [_0x5e8e36,_0x47d175]of this[_0x182a('0x17')][_0x182a('0x14')])_0x47d175[_0x182a('0x1b')]&&_0x182a('0x6')!==_0x5e8e36&&_0x47d175['clearForceDisabled'](_0x182a('0xc'));this[_0x182a('0xd')](this[_0x182a('0x17')][_0x182a('0xe')][_0x182a('0x19')][_0x182a('0x11')]);}}
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';
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
+ };
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';
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,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';
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(_0x2e3a4b,_0x297c16,_0x237ee2){const t=_0x2e3a4b['t'];switch(_0x297c16){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'},_0x237ee2);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'},_0x237ee2);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'},_0x237ee2);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'},_0x237ee2);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'';}}
23
+ export function getTranslation(_0x184645,_0x439412,_0x951184){const t=_0x184645['t'];switch(_0x439412){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'},_0x951184);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'},_0x951184);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'},_0x951184);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'},_0x951184);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 _0x572a=['disconnect','type','attributes','observe','childList','attributeName'];(function(_0xfced96,_0x572a78){const _0x224b74=function(_0x30d968){while(--_0x30d968){_0xfced96['push'](_0xfced96['shift']());}};_0x224b74(++_0x572a78);}(_0x572a,0xa6));const _0x224b=function(_0xfced96,_0x572a78){_0xfced96=_0xfced96-0x0;let _0x224b74=_0x572a[_0xfced96];return _0x224b74;};import{throttle as _0x343cb9}from'lodash-es';export default function Dt(_0x3f7a1c){const _0x2a38de=_0x343cb9(_0x3f7a1c,0x1e),_0x3d44c2=new MutationObserver(_0x461a94=>{for(const _0x445337 of _0x461a94)(_0x224b('0x4')==_0x445337[_0x224b('0x3')]&&'class'==_0x445337[_0x224b('0x1')]||_0x224b('0x0')==_0x445337[_0x224b('0x3')]||'characterData'==_0x445337[_0x224b('0x3')])&&_0x2a38de();});return{'attach'(_0x31ab14){_0x3d44c2[_0x224b('0x5')](_0x31ab14,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0x3d44c2[_0x224b('0x2')](),_0x2a38de['cancel']();}};}
23
+ const _0x30a2=['cancel','type','childList','disconnect','attributeName','class'];(function(_0x50b361,_0x30a23c){const _0x2d326a=function(_0x747ecc){while(--_0x747ecc){_0x50b361['push'](_0x50b361['shift']());}};_0x2d326a(++_0x30a23c);}(_0x30a2,0x1b7));const _0x2d32=function(_0x50b361,_0x30a23c){_0x50b361=_0x50b361-0x0;let _0x2d326a=_0x30a2[_0x50b361];return _0x2d326a;};import{throttle as _0x48b77e}from'lodash-es';export default function Dt(_0x4817cb){const _0x30059f=_0x48b77e(_0x4817cb,0x1e),_0xd919d2=new MutationObserver(_0x26c285=>{for(const _0x1eaf03 of _0x26c285)('attributes'==_0x1eaf03['type']&&_0x2d32('0x4')==_0x1eaf03[_0x2d32('0x3')]||_0x2d32('0x1')==_0x1eaf03[_0x2d32('0x0')]||'characterData'==_0x1eaf03['type'])&&_0x30059f();});return{'attach'(_0x2ba6c8){_0xd919d2['observe'](_0x2ba6c8,{'attributes':!0x0,'childList':!0x0,'subtree':!0x0,'characterData':!0x0});},'detach'(){_0xd919d2[_0x2d32('0x2')](),_0x30059f[_0x2d32('0x5')]();}};}