@ckeditor/ckeditor5-comments 40.0.0 → 40.2.0
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/CHANGELOG.md +19 -19
- package/LICENSE.md +3 -3
- package/README.md +1 -1
- package/build/comments.js +2 -2
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sq.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/lang/contexts.json +2 -0
- package/lang/translations/af.po +8 -0
- package/lang/translations/ar.po +8 -0
- package/lang/translations/bg.po +8 -0
- package/lang/translations/bn.po +8 -0
- package/lang/translations/bs.po +8 -0
- package/lang/translations/ca.po +8 -0
- package/lang/translations/cs.po +8 -0
- package/lang/translations/da.po +8 -0
- package/lang/translations/de-ch.po +8 -0
- package/lang/translations/de.po +8 -0
- package/lang/translations/el.po +8 -0
- package/lang/translations/en-au.po +8 -0
- package/lang/translations/en.po +8 -0
- package/lang/translations/es-co.po +8 -0
- package/lang/translations/es.po +8 -0
- package/lang/translations/et.po +8 -0
- package/lang/translations/fa.po +8 -0
- package/lang/translations/fi.po +8 -0
- package/lang/translations/fr.po +8 -0
- package/lang/translations/gl.po +8 -0
- package/lang/translations/he.po +8 -0
- package/lang/translations/hi.po +8 -0
- package/lang/translations/hr.po +8 -0
- package/lang/translations/hu.po +8 -0
- package/lang/translations/id.po +8 -0
- package/lang/translations/it.po +8 -0
- package/lang/translations/ja.po +8 -0
- package/lang/translations/jv.po +8 -0
- package/lang/translations/ko.po +8 -0
- package/lang/translations/lt.po +8 -0
- package/lang/translations/lv.po +8 -0
- package/lang/translations/ms.po +8 -0
- package/lang/translations/nl.po +8 -0
- package/lang/translations/no.po +8 -0
- package/lang/translations/pl.po +8 -0
- package/lang/translations/pt-br.po +8 -0
- package/lang/translations/pt.po +8 -0
- package/lang/translations/ro.po +8 -0
- package/lang/translations/ru.po +8 -0
- package/lang/translations/sk.po +8 -0
- package/lang/translations/sq.po +8 -0
- package/lang/translations/sr-latn.po +9 -1
- package/lang/translations/sr.po +8 -0
- package/lang/translations/sv.po +8 -0
- package/lang/translations/th.po +8 -0
- package/lang/translations/tk.po +8 -0
- package/lang/translations/tr.po +8 -0
- package/lang/translations/tt.po +8 -0
- package/lang/translations/ug.po +16 -8
- package/lang/translations/uk.po +8 -0
- package/lang/translations/ur.po +8 -0
- package/lang/translations/vi.po +8 -0
- package/lang/translations/zh-cn.po +8 -0
- package/lang/translations/zh.po +8 -0
- package/package.json +3 -3
- package/src/annotations/annotation.d.ts +90 -90
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.d.ts +98 -98
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.d.ts +154 -154
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.d.ts +232 -232
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +67 -67
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +90 -90
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +85 -85
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.d.ts +100 -100
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.d.ts +29 -29
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.d.ts +90 -90
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.d.ts +55 -55
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.d.ts +32 -32
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.d.ts +77 -77
- package/src/annotations/widesidebar.js +1 -1
- package/src/augmentation.d.ts +52 -52
- package/src/comments/addcommentthreadcommand.d.ts +35 -35
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.d.ts +31 -31
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.d.ts +38 -38
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.d.ts +79 -79
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1130 -1129
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +33 -33
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.d.ts +17 -17
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.d.ts +21 -21
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.d.ts +36 -36
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.d.ts +31 -31
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +36 -36
- 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 +119 -119
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.d.ts +112 -112
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.d.ts +13 -13
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.d.ts +14 -14
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.d.ts +86 -86
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.d.ts +38 -38
- package/src/comments/ui/view/commentsarchiveview.js +1 -1
- package/src/comments/ui/view/commentslistview.d.ts +100 -100
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.d.ts +50 -50
- package/src/comments/ui/view/commentthreadheaderview.js +1 -1
- package/src/comments/ui/view/commentthreadinputview.d.ts +41 -41
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.d.ts +118 -118
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.d.ts +243 -243
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.d.ts +35 -35
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +33 -33
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +176 -176
- package/src/index.d.ts +24 -24
- package/src/utils/common-translations.d.ts +9 -9
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.d.ts +14 -14
- package/src/utils/createmutationobserver.js +1 -1
- package/theme/comment.css +1 -1
package/src/augmentation.d.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
import type { CommentsConfig, SidebarConfig, Annotations, AnnotationsUIs, EditorAnnotations, CommentsRepository, CommentsUI } from './index';
|
|
6
|
-
declare module '@ckeditor/ckeditor5-core' {
|
|
7
|
-
interface EditorConfig {
|
|
8
|
-
/**
|
|
9
|
-
* The configuration of the comments feature.
|
|
10
|
-
* Introduced by the {@link module:comments/comments~Comments} feature.
|
|
11
|
-
*
|
|
12
|
-
* Read more in {@link module:comments/config~CommentsConfig}.
|
|
13
|
-
*
|
|
14
|
-
* ```ts
|
|
15
|
-
* ClassicEditor
|
|
16
|
-
* .create( {
|
|
17
|
-
* comments: ... // Locale editor configuration.
|
|
18
|
-
* } )
|
|
19
|
-
* .then( ... )
|
|
20
|
-
* .catch( ... );
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
24
|
-
*/
|
|
25
|
-
comments?: CommentsConfig;
|
|
26
|
-
/**
|
|
27
|
-
* The configuration of the sidebar feature.
|
|
28
|
-
* Introduced by the {@link module:comments/annotations/sidebar~Sidebar} feature.
|
|
29
|
-
*/
|
|
30
|
-
sidebar?: SidebarConfig;
|
|
31
|
-
/**
|
|
32
|
-
* Enables {@link module:comments/commentsonly~CommentsOnly comments-only mode} when the editor initializes.
|
|
33
|
-
*
|
|
34
|
-
* ```ts
|
|
35
|
-
* ClassicEditor
|
|
36
|
-
* .create( {
|
|
37
|
-
* commentsOnly: true
|
|
38
|
-
* } )
|
|
39
|
-
* .then( ... )
|
|
40
|
-
* .catch( ... );
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
commentsOnly?: boolean;
|
|
44
|
-
}
|
|
45
|
-
interface PluginsMap {
|
|
46
|
-
[Annotations.pluginName]: Annotations;
|
|
47
|
-
[AnnotationsUIs.pluginName]: AnnotationsUIs;
|
|
48
|
-
[EditorAnnotations.pluginName]: EditorAnnotations;
|
|
49
|
-
[CommentsRepository.pluginName]: CommentsRepository;
|
|
50
|
-
[CommentsUI.pluginName]: CommentsUI;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import type { CommentsConfig, SidebarConfig, Annotations, AnnotationsUIs, EditorAnnotations, CommentsRepository, CommentsUI } from './index';
|
|
6
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
7
|
+
interface EditorConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The configuration of the comments feature.
|
|
10
|
+
* Introduced by the {@link module:comments/comments~Comments} feature.
|
|
11
|
+
*
|
|
12
|
+
* Read more in {@link module:comments/config~CommentsConfig}.
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* ClassicEditor
|
|
16
|
+
* .create( {
|
|
17
|
+
* comments: ... // Locale editor configuration.
|
|
18
|
+
* } )
|
|
19
|
+
* .then( ... )
|
|
20
|
+
* .catch( ... );
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
24
|
+
*/
|
|
25
|
+
comments?: CommentsConfig;
|
|
26
|
+
/**
|
|
27
|
+
* The configuration of the sidebar feature.
|
|
28
|
+
* Introduced by the {@link module:comments/annotations/sidebar~Sidebar} feature.
|
|
29
|
+
*/
|
|
30
|
+
sidebar?: SidebarConfig;
|
|
31
|
+
/**
|
|
32
|
+
* Enables {@link module:comments/commentsonly~CommentsOnly comments-only mode} when the editor initializes.
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* ClassicEditor
|
|
36
|
+
* .create( {
|
|
37
|
+
* commentsOnly: true
|
|
38
|
+
* } )
|
|
39
|
+
* .then( ... )
|
|
40
|
+
* .catch( ... );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
commentsOnly?: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface PluginsMap {
|
|
46
|
+
[Annotations.pluginName]: Annotations;
|
|
47
|
+
[AnnotationsUIs.pluginName]: AnnotationsUIs;
|
|
48
|
+
[EditorAnnotations.pluginName]: EditorAnnotations;
|
|
49
|
+
[CommentsRepository.pluginName]: CommentsRepository;
|
|
50
|
+
[CommentsUI.pluginName]: CommentsUI;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module comments/comments/addcommentthreadcommand
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { Command } from 'ckeditor5/src/core';
|
|
10
|
-
/**
|
|
11
|
-
* Adds a new CommentMarker what automatically adds corresponding CommentThread to the CommentsEditing#threads collection.
|
|
12
|
-
* Note this command adds only a CommentThread draft, to make is public marker has to be changed to be managed using operation.
|
|
13
|
-
*
|
|
14
|
-
* ```ts
|
|
15
|
-
* // If `threadId` is not specified, `addCommentThread()` will generate a unique ID and use it:
|
|
16
|
-
* editor.execute( 'addCommentThread' );
|
|
17
|
-
*
|
|
18
|
-
* // If you want to specify the exact thread ID, pass it through the optional `threadId` configuration parameter.
|
|
19
|
-
* editor.execute( 'addCommentThread', { threadId: 'thread-1' } );
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export default class AddCommentThreadCommand extends Command {
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
refresh(): void;
|
|
27
|
-
/**
|
|
28
|
-
* @fires execute
|
|
29
|
-
* @param options Options for executed command.
|
|
30
|
-
* @param options.threadId Id of comment marker that will be added.
|
|
31
|
-
*/
|
|
32
|
-
execute({ threadId }?: {
|
|
33
|
-
threadId?: string | undefined;
|
|
34
|
-
}): void;
|
|
35
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module comments/comments/addcommentthreadcommand
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Command } from 'ckeditor5/src/core';
|
|
10
|
+
/**
|
|
11
|
+
* Adds a new CommentMarker what automatically adds corresponding CommentThread to the CommentsEditing#threads collection.
|
|
12
|
+
* Note this command adds only a CommentThread draft, to make is public marker has to be changed to be managed using operation.
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* // If `threadId` is not specified, `addCommentThread()` will generate a unique ID and use it:
|
|
16
|
+
* editor.execute( 'addCommentThread' );
|
|
17
|
+
*
|
|
18
|
+
* // If you want to specify the exact thread ID, pass it through the optional `threadId` configuration parameter.
|
|
19
|
+
* editor.execute( 'addCommentThread', { threadId: 'thread-1' } );
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export default class AddCommentThreadCommand extends Command {
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
refresh(): void;
|
|
27
|
+
/**
|
|
28
|
+
* @fires execute
|
|
29
|
+
* @param options Options for executed command.
|
|
30
|
+
* @param options.threadId Id of comment marker that will be added.
|
|
31
|
+
*/
|
|
32
|
+
execute({ threadId }?: {
|
|
33
|
+
threadId?: string | undefined;
|
|
34
|
+
}): void;
|
|
35
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1d75=['getRanges','isEnabled','change','_trimToContent','substr','addMarker','schema','_hasContent','isObject','backward','element','model','_itemIsContent','selection','document','editor','end','comment:','tableCell'];(function(_0x2db901,_0x1d75b8){const _0x3b63e2=function(_0x85b5aa){while(--_0x85b5aa){_0x2db901['push'](_0x2db901['shift']());}};_0x3b63e2(++_0x1d75b8);}(_0x1d75,0x6f));const _0x3b63=function(_0x2db901,_0x1d75b8){_0x2db901=_0x2db901-0x0;let _0x3b63e2=_0x1d75[_0x2db901];return _0x3b63e2;};import{Command as _0x250a0c}from'ckeditor5/src/core';import{uid as _0x202f60}from'ckeditor5/src/utils';export default class q extends _0x250a0c{['refresh'](){const _0x1422f7=this[_0x3b63('0x12')][_0x3b63('0xe')][_0x3b63('0x11')]['selection'];for(const _0x3749a0 of _0x1422f7[_0x3b63('0x3')]())if(this[_0x3b63('0xa')](_0x3749a0))return void(this[_0x3b63('0x4')]=!0x0);this[_0x3b63('0x4')]=!0x1;}['execute']({threadId:_0x11cc10=_0x202f60()}={}){const _0x20c1a4=this['editor'][_0x3b63('0xe')],_0x23aa4a=[];for(const _0x406f1f of _0x20c1a4[_0x3b63('0x11')][_0x3b63('0x10')][_0x3b63('0x3')]())this[_0x3b63('0xa')](_0x406f1f)&&_0x23aa4a['push'](this[_0x3b63('0x6')](_0x406f1f));_0x20c1a4[_0x3b63('0x5')](_0x4a4fc2=>{for(const _0x5dbe93 of _0x23aa4a){const _0x14f03f=_0x202f60()[_0x3b63('0x7')](0x1,0x5),_0x10be15=_0x3b63('0x1')+_0x11cc10+':'+_0x14f03f;_0x4a4fc2[_0x3b63('0x8')](_0x10be15,{'range':_0x5dbe93,'usingOperation':!0x1,'affectsData':!0x1});}});}['_hasContent'](_0x23be98){for(const _0x4e7c66 of _0x23be98['getItems']())if(this['_itemIsContent'](_0x4e7c66))return!0x0;return!0x1;}[_0x3b63('0xf')](_0x3b83da){return _0x3b83da['is']('$textProxy')||this[_0x3b63('0x12')][_0x3b63('0xe')][_0x3b63('0x9')][_0x3b63('0xb')](_0x3b83da)&&!_0x3b83da['is'](_0x3b63('0xd'),_0x3b63('0x2'));}['_trimToContent'](_0x18a85a){const _0xde1d9b=_0x541103=>!this[_0x3b63('0xf')](_0x541103['item']),_0x654af4=_0x18a85a['start']['getLastMatchingPosition'](_0xde1d9b),_0x3ec6fd=_0x18a85a[_0x3b63('0x0')]['getLastMatchingPosition'](_0xde1d9b,{'direction':_0x3b63('0xc')});return this['editor'][_0x3b63('0xe')]['createRange'](_0x654af4,_0x3ec6fd);}}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module comments/comments/commentsarchive
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
|
|
10
|
-
import { Collection } from 'ckeditor5/src/utils';
|
|
11
|
-
import CommentsRepository, { type CommentThread } from './commentsrepository';
|
|
12
|
-
import Annotations from '../annotations/annotations';
|
|
13
|
-
/**
|
|
14
|
-
* This plugin handles all operations on archived threads needed for the comments archive.
|
|
15
|
-
*/
|
|
16
|
-
export default class CommentsArchive extends ContextPlugin {
|
|
17
|
-
archivedThreads: Collection<CommentThread>;
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName(): "CommentsArchive";
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
static get requires(): readonly [typeof CommentsRepository, typeof Annotations];
|
|
26
|
-
constructor(context: Context | Editor);
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
init(): void;
|
|
31
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module comments/comments/commentsarchive
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
|
|
10
|
+
import { Collection } from 'ckeditor5/src/utils';
|
|
11
|
+
import CommentsRepository, { type CommentThread } from './commentsrepository';
|
|
12
|
+
import Annotations from '../annotations/annotations';
|
|
13
|
+
/**
|
|
14
|
+
* This plugin handles all operations on archived threads needed for the comments archive.
|
|
15
|
+
*/
|
|
16
|
+
export default class CommentsArchive extends ContextPlugin {
|
|
17
|
+
archivedThreads: Collection<CommentThread>;
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName(): "CommentsArchive";
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get requires(): readonly [typeof CommentsRepository, typeof Annotations];
|
|
26
|
+
constructor(context: Context | Editor);
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
init(): void;
|
|
31
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xa00d=['archivedThreads','pluginName','change:archivedAt','removeCommentThread','plugins','remove','highest','focus','has','context','add','archivedAt','CommentsArchive','length','get','listenTo','requires','getCommentThread','findIndex','stopListening','isActive','_calculatePosition'];(function(_0x39fcb5,_0xa00deb){const _0x2cb7fa=function(_0x438dfc){while(--_0x438dfc){_0x39fcb5['push'](_0x39fcb5['shift']());}};_0x2cb7fa(++_0xa00deb);}(_0xa00d,0x157));const _0x2cb7=function(_0x39fcb5,_0xa00deb){_0x39fcb5=_0x39fcb5-0x0;let _0x2cb7fa=_0xa00d[_0x39fcb5];return _0x2cb7fa;};import{ContextPlugin as _0x359a4a}from'ckeditor5/src/core';import{Collection as _0x3521e0}from'ckeditor5/src/utils';import _0x363144 from'./commentsrepository';import _0x54f952 from'../annotations/annotations';export default class p extends _0x359a4a{static get[_0x2cb7('0xa')](){return _0x2cb7('0x15');}static get[_0x2cb7('0x3')](){return[_0x363144,_0x54f952];}constructor(_0x59492b){super(_0x59492b),this[_0x2cb7('0x9')]=new _0x3521e0();}['init'](){const _0x3a8623=this[_0x2cb7('0x12')],_0x1c18ef=_0x3a8623[_0x2cb7('0xd')][_0x2cb7('0x1')](_0x363144),_0x49852c=_0x3a8623['plugins']['get'](_0x54f952);this[_0x2cb7('0x2')](_0x1c18ef,'addCommentThread',(_0x336d32,{threadId:_0x1884c2})=>{const _0x1ad89d=_0x1c18ef[_0x2cb7('0x4')](_0x1884c2);_0x1ad89d[_0x2cb7('0x14')]&&this[_0x2cb7('0x9')][_0x2cb7('0x13')](_0x1ad89d,this[_0x2cb7('0x8')](_0x1ad89d[_0x2cb7('0x14')])),this['listenTo'](_0x1ad89d,_0x2cb7('0xb'),(_0x2df3b0,_0x1073dc,_0x2cf7c8)=>{_0x2cf7c8?this[_0x2cb7('0x9')][_0x2cb7('0x11')](_0x1ad89d)||this[_0x2cb7('0x9')][_0x2cb7('0x13')](_0x1ad89d,this[_0x2cb7('0x8')](_0x1ad89d[_0x2cb7('0x14')])):this[_0x2cb7('0x9')][_0x2cb7('0x11')](_0x1ad89d)&&this[_0x2cb7('0x9')]['remove'](_0x1ad89d);});}),this[_0x2cb7('0x2')](_0x1c18ef,_0x2cb7('0xc'),(_0x56fb84,{threadId:_0x4bf7ba})=>{const _0x1aee22=_0x1c18ef[_0x2cb7('0x4')](_0x4bf7ba);this[_0x2cb7('0x6')](_0x1aee22),this[_0x2cb7('0x9')][_0x2cb7('0x11')](_0x1aee22)&&this[_0x2cb7('0x9')][_0x2cb7('0xe')](_0x1aee22);},{'priority':_0x2cb7('0xf')}),this['listenTo'](_0x49852c['collection'],_0x2cb7('0x10'),(_0x25b315,_0x127b08)=>{_0x127b08[_0x2cb7('0x7')]=!0x0,_0x49852c['activate'](_0x127b08);});}[_0x2cb7('0x8')](_0x58c563){const _0x2a3bd4=[...this[_0x2cb7('0x9')]][_0x2cb7('0x5')](_0xf093d2=>_0xf093d2[_0x2cb7('0x14')]<_0x58c563);return _0x2a3bd4>-0x1?_0x2a3bd4:this['archivedThreads'][_0x2cb7('0x0')];}}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module comments/comments/commentsarchiveui
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import '../../theme/commentsarchive.css';
|
|
10
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
11
|
-
import { ViewCollection } from 'ckeditor5/src/ui';
|
|
12
|
-
import CommentsArchiveView from './ui/view/commentsarchiveview';
|
|
13
|
-
import CommentsArchive from './commentsarchive';
|
|
14
|
-
import type AnnotationView from '../annotations/view/annotationview';
|
|
15
|
-
/**
|
|
16
|
-
* Creates comments archive {@link module:ui/dropdown/dropdownview~DropdownView ui dropdown} and binds with
|
|
17
|
-
* archived comment thread annotation views.
|
|
18
|
-
*/
|
|
19
|
-
export default class CommentsArchiveUI extends Plugin {
|
|
20
|
-
commentsArchiveView: CommentsArchiveView | undefined;
|
|
21
|
-
annotationViews: ViewCollection<AnnotationView>;
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
static get pluginName(): "CommentsArchiveUI";
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
static get requires(): readonly [typeof CommentsArchive];
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
constructor(editor: Editor);
|
|
34
|
-
/**
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
init(): void;
|
|
38
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module comments/comments/commentsarchiveui
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import '../../theme/commentsarchive.css';
|
|
10
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
11
|
+
import { ViewCollection } from 'ckeditor5/src/ui';
|
|
12
|
+
import CommentsArchiveView from './ui/view/commentsarchiveview';
|
|
13
|
+
import CommentsArchive from './commentsarchive';
|
|
14
|
+
import type AnnotationView from '../annotations/view/annotationview';
|
|
15
|
+
/**
|
|
16
|
+
* Creates comments archive {@link module:ui/dropdown/dropdownview~DropdownView ui dropdown} and binds with
|
|
17
|
+
* archived comment thread annotation views.
|
|
18
|
+
*/
|
|
19
|
+
export default class CommentsArchiveUI extends Plugin {
|
|
20
|
+
commentsArchiveView: CommentsArchiveView | undefined;
|
|
21
|
+
annotationViews: ViewCollection<AnnotationView>;
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "CommentsArchiveUI";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires(): readonly [typeof CommentsArchive];
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
constructor(editor: Editor);
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
init(): void;
|
|
38
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x478f=['editor','locale','extendTemplate','commentsArchive','getByInnerView','plugins','componentFactory','ck-body','_createArchiveUIDropdown','requires','get','add','_handleAnnotationFocusableElements','classList','findIndex','stopListening','_calculatePosition','archivedAt','init','buttonView','contains','COMMENTS_ARCHIVE','_visibleAnnotations','find','_pendingThreads','panelView','mainView','config','listenTo','children','focusableElements','Annotations','annotationViews','archivedThreads','focusTracker','isVisible','commentsArchiveView','innerView','position','push','change:isOpen','pluginName','collaboration.channelId','channelId','_threadToController','CommentsRepository','remove','view','length'];(function(_0xec6e50,_0x478f38){const _0x46f2f7=function(_0x12d18f){while(--_0x12d18f){_0xec6e50['push'](_0xec6e50['shift']());}};_0x46f2f7(++_0x478f38);}(_0x478f,0xa2));const _0x46f2=function(_0xec6e50,_0x478f38){_0xec6e50=_0xec6e50-0x0;let _0x46f2f7=_0x478f[_0xec6e50];return _0x46f2f7;};import'../../theme/commentsarchive.css';import{Plugin as _0x3eb50c}from'ckeditor5/src/core';import{createDropdown as _0x2ddaec,ViewCollection as _0x3437c0}from'ckeditor5/src/ui';import _0x1f8218 from'../../theme/icons/comments-archive.svg';import{getTranslation as _0x31dc91}from'../utils/common-translations';import _0x333730 from'./ui/view/commentsarchiveview';import _0xb59a10 from'./commentsarchive';export default class a extends _0x3eb50c{static get[_0x46f2('0x1a')](){return'CommentsArchiveUI';}static get[_0x46f2('0x2b')](){return[_0xb59a10];}constructor(_0x2f9145){super(_0x2f9145),this[_0x46f2('0x11')]=new _0x3437c0(),this[_0x46f2('0x9')]=[];}[_0x46f2('0x3')](){this[_0x46f2('0x22')]['ui'][_0x46f2('0x28')]['add'](_0x46f2('0x25'),()=>this[_0x46f2('0x2a')]());const _0xa07016=this['editor'][_0x46f2('0x27')][_0x46f2('0x2c')](_0xb59a10),_0x4aaca8=this[_0x46f2('0x22')][_0x46f2('0x27')][_0x46f2('0x2c')](_0x46f2('0x10')),_0x3e5900=this[_0x46f2('0x22')][_0x46f2('0x27')][_0x46f2('0x2c')](_0x46f2('0x1e'));this[_0x46f2('0xd')](_0xa07016[_0x46f2('0x12')],_0x46f2('0x2d'),(_0x582559,_0x2c6eed)=>{const _0x526b6d=this[_0x46f2('0x22')]['config'][_0x46f2('0x2c')](_0x46f2('0x1b'));if(!_0x526b6d||_0x2c6eed[_0x46f2('0x1c')]===_0x526b6d){const _0x3d0882=this[_0x46f2('0x1')](_0x2c6eed[_0x46f2('0x2')]),_0x2573d1=_0x3e5900[_0x46f2('0x1d')][_0x46f2('0x2c')](_0x2c6eed);if(!_0x2573d1)return void this[_0x46f2('0x9')][_0x46f2('0x18')]({'thread':_0x2c6eed,'position':_0x3d0882});const _0x43c7ea=_0x4aaca8[_0x46f2('0x26')](_0x2573d1[_0x46f2('0x20')]);_0x43c7ea[_0x46f2('0x14')]&&_0x4aaca8[_0x46f2('0x7')][_0x46f2('0x1f')](_0x43c7ea),this['annotationViews']['add'](_0x43c7ea[_0x46f2('0x20')],_0x3d0882);}}),this[_0x46f2('0xd')](_0x4aaca8['collection'],_0x46f2('0x2d'),(_0x4d1739,_0x277d07)=>{const _0x8ca19d=this[_0x46f2('0x9')][_0x46f2('0x8')](({thread:_0x161f07})=>{const _0x3f065e=_0x3e5900[_0x46f2('0x1d')][_0x46f2('0x2c')](_0x161f07);return _0x3f065e&&_0x277d07[_0x46f2('0x16')]===_0x3f065e['view'];});_0x8ca19d&&(this[_0x46f2('0x11')]['add'](_0x277d07[_0x46f2('0x20')],_0x8ca19d[_0x46f2('0x17')]),this['_pendingThreads']['splice'](this['_pendingThreads']['indexOf'](_0x8ca19d),0x1));}),this['listenTo'](_0xa07016['archivedThreads'],_0x46f2('0x1f'),(_0x16efac,_0x239316)=>{const _0x58b493=this[_0x46f2('0x22')]['config'][_0x46f2('0x2c')](_0x46f2('0x1b'));if(!_0x58b493||_0x239316[_0x46f2('0x1c')]===_0x58b493){const _0x298703=_0x3e5900[_0x46f2('0x1d')][_0x46f2('0x2c')](_0x239316),_0x38dd50=_0x4aaca8[_0x46f2('0x26')](_0x298703[_0x46f2('0x20')]);this[_0x46f2('0x11')][_0x46f2('0x1f')](_0x38dd50[_0x46f2('0x20')]),this[_0x46f2('0x0')](_0x38dd50['focusableElements']);}});}['_handleAnnotationFocusableElements'](_0x235b28,_0x501f6f){for(const _0xcad240 of _0x501f6f['focusableElements'])_0xcad240[_0x46f2('0x2f')][_0x46f2('0x5')](_0x46f2('0x29'))&&_0x235b28[_0x46f2('0x13')]['add'](_0xcad240);this['listenTo'](_0x501f6f[_0x46f2('0xf')],_0x46f2('0x2d'),(_0x89d405,_0x14cbee)=>{_0x14cbee[_0x46f2('0x2f')]['contains'](_0x46f2('0x29'))&&_0x235b28[_0x46f2('0x13')][_0x46f2('0x2d')](_0x14cbee);}),this[_0x46f2('0xd')](_0x501f6f[_0x46f2('0xf')],_0x46f2('0x1f'),(_0x3b8917,_0x3c4152)=>{_0x3c4152[_0x46f2('0x2f')]['contains'](_0x46f2('0x29'))&&_0x235b28[_0x46f2('0x13')][_0x46f2('0x1f')](_0x3c4152);});}[_0x46f2('0x1')](_0x23e64b){const _0xa701de=this[_0x46f2('0x22')][_0x46f2('0xc')][_0x46f2('0x2c')](_0x46f2('0x1b')),_0x422c82=[...this[_0x46f2('0x22')][_0x46f2('0x27')]['get'](_0xb59a10)['archivedThreads']]['filter'](_0x606482=>_0x606482[_0x46f2('0x1c')]===_0xa701de)[_0x46f2('0x30')](_0x2800f6=>_0x2800f6[_0x46f2('0x2')]<_0x23e64b);return _0x422c82>-0x1?_0x422c82-0x1:this[_0x46f2('0x11')][_0x46f2('0x21')];}[_0x46f2('0x2a')](){const _0x2f9e51=this['editor'],_0x50aa69=this['editor']['plugins'][_0x46f2('0x2c')](_0x46f2('0x10')),_0x44da79=_0x2ddaec(_0x2f9e51[_0x46f2('0x23')]);_0x44da79[_0x46f2('0x4')]['set']({'icon':_0x1f8218,'label':_0x31dc91(_0x2f9e51[_0x46f2('0x23')],_0x46f2('0x6')),'tooltip':!0x0}),_0x44da79['panelView'][_0x46f2('0x24')]({'attributes':{'class':'ck-comments-archive-dropdown'}}),_0x44da79['on'](_0x46f2('0x19'),(_0x32073a,_0x59d090,_0xca5d6b)=>{this[_0x46f2('0x15')]||(this[_0x46f2('0x15')]=new _0x333730(_0x2f9e51['locale'],this[_0x46f2('0x11')])),_0xca5d6b?_0x44da79[_0x46f2('0xa')][_0x46f2('0xe')][_0x46f2('0x2d')](this[_0x46f2('0x15')]):_0x44da79[_0x46f2('0xa')][_0x46f2('0xe')]['remove'](this[_0x46f2('0x15')]);});for(const _0x159185 of this[_0x46f2('0x11')]){const _0x1c42f0=_0x50aa69['getByInnerView'](_0x159185[_0x46f2('0xb')]);this['_handleAnnotationFocusableElements'](_0x44da79,_0x1c42f0);}return _0x44da79['listenTo'](this[_0x46f2('0x11')],_0x46f2('0x2d'),(_0x33f922,_0x1e9e52)=>{const _0x48a3f0=_0x50aa69[_0x46f2('0x26')](_0x1e9e52['mainView']);this[_0x46f2('0x2e')](_0x44da79,_0x48a3f0);}),_0x44da79['listenTo'](this['annotationViews'],'remove',(_0x2bc24e,_0x255720)=>{const _0x127fcc=_0x50aa69[_0x46f2('0x26')](_0x255720['mainView']);for(const _0x586ce8 of _0x127fcc['focusableElements'])_0x586ce8['classList'][_0x46f2('0x5')](_0x46f2('0x29'))&&_0x44da79[_0x46f2('0x13')][_0x46f2('0x1f')](_0x586ce8);}),_0x44da79;}}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module comments/comments/commentsediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
9
|
-
import type { Marker } from 'ckeditor5/src/engine';
|
|
10
|
-
import CommentsRepository from './commentsrepository';
|
|
11
|
-
import EditorAnnotations from '../annotations/editorannotations';
|
|
12
|
-
import CommentsRestrictedEditingMode from './integrations/commentsrestrictededitingmode';
|
|
13
|
-
import '../../theme/commentmarker.css';
|
|
14
|
-
import CommentsImportWord from './integrations/importword';
|
|
15
|
-
/**
|
|
16
|
-
* Plugin that keeps in sync comments in {@link module:comments/comments/commentsrepository~CommentsRepository} with
|
|
17
|
-
* {@link module:engine/model/markercollection~Marker comment markers}.
|
|
18
|
-
*/
|
|
19
|
-
export default class CommentsEditing extends Plugin {
|
|
20
|
-
/**
|
|
21
|
-
* If set to `true`, the plugin won't load comment thread for the new marker immediately after the marker is added to the editor.
|
|
22
|
-
* Instead, the plugin will wait until the flag will be set to `false` and then load missing comments.
|
|
23
|
-
*
|
|
24
|
-
* It's useful to hold fetching comments from the server when comments are used with real-time collaboration.
|
|
25
|
-
* When a user connects to an existing document, the operations from the history need to be applied one by one.
|
|
26
|
-
* An operation which added a new comment marker might be followed by an operation which removes that marker, so it's not
|
|
27
|
-
* necessary to make an additional request then.
|
|
28
|
-
*
|
|
29
|
-
* @observable
|
|
30
|
-
*/
|
|
31
|
-
isThreadsLoadingPaused: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Name of the active comment marker.
|
|
34
|
-
*
|
|
35
|
-
* Markers conversion checks if comment should be marked as active and adds/removes additional css class during the conversion.
|
|
36
|
-
*
|
|
37
|
-
* @observable
|
|
38
|
-
*/
|
|
39
|
-
activeMarker: string | null;
|
|
40
|
-
/**
|
|
41
|
-
* @inheritDoc
|
|
42
|
-
*/
|
|
43
|
-
static get requires(): readonly [typeof CommentsRepository, typeof EditorAnnotations, typeof CommentsRestrictedEditingMode, typeof CommentsImportWord];
|
|
44
|
-
/**
|
|
45
|
-
* @inheritDoc
|
|
46
|
-
*/
|
|
47
|
-
static get pluginName(): "CommentsEditing";
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
constructor(editor: Editor);
|
|
52
|
-
/**
|
|
53
|
-
* @inheritDoc
|
|
54
|
-
*/
|
|
55
|
-
init(): void;
|
|
56
|
-
/**
|
|
57
|
-
* @inheritDoc
|
|
58
|
-
*/
|
|
59
|
-
destroy(): void;
|
|
60
|
-
/**
|
|
61
|
-
* Returns `true` if there is at least one marker in the content that is related to a comment thread with given `threadId`.
|
|
62
|
-
*
|
|
63
|
-
* @param threadId Comment thread id.
|
|
64
|
-
*/
|
|
65
|
-
hasMarkerForId(threadId: string): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Returns all markers that are related to the comment thread with the given `threadId`.
|
|
68
|
-
*
|
|
69
|
-
* @param threadId Comment thread id.
|
|
70
|
-
* @returns Array with all markers related to given comment thread.
|
|
71
|
-
*/
|
|
72
|
-
getAllMarkersForId(threadId: string): Array<Marker>;
|
|
73
|
-
/**
|
|
74
|
-
* Scrolls editing view to the first thread marker.
|
|
75
|
-
*
|
|
76
|
-
* @param threadId Comment thread id.
|
|
77
|
-
*/
|
|
78
|
-
scrollToThreadMarker(threadId: string): void;
|
|
79
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module comments/comments/commentsediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
9
|
+
import type { Marker } from 'ckeditor5/src/engine';
|
|
10
|
+
import CommentsRepository from './commentsrepository';
|
|
11
|
+
import EditorAnnotations from '../annotations/editorannotations';
|
|
12
|
+
import CommentsRestrictedEditingMode from './integrations/commentsrestrictededitingmode';
|
|
13
|
+
import '../../theme/commentmarker.css';
|
|
14
|
+
import CommentsImportWord from './integrations/importword';
|
|
15
|
+
/**
|
|
16
|
+
* Plugin that keeps in sync comments in {@link module:comments/comments/commentsrepository~CommentsRepository} with
|
|
17
|
+
* {@link module:engine/model/markercollection~Marker comment markers}.
|
|
18
|
+
*/
|
|
19
|
+
export default class CommentsEditing extends Plugin {
|
|
20
|
+
/**
|
|
21
|
+
* If set to `true`, the plugin won't load comment thread for the new marker immediately after the marker is added to the editor.
|
|
22
|
+
* Instead, the plugin will wait until the flag will be set to `false` and then load missing comments.
|
|
23
|
+
*
|
|
24
|
+
* It's useful to hold fetching comments from the server when comments are used with real-time collaboration.
|
|
25
|
+
* When a user connects to an existing document, the operations from the history need to be applied one by one.
|
|
26
|
+
* An operation which added a new comment marker might be followed by an operation which removes that marker, so it's not
|
|
27
|
+
* necessary to make an additional request then.
|
|
28
|
+
*
|
|
29
|
+
* @observable
|
|
30
|
+
*/
|
|
31
|
+
isThreadsLoadingPaused: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Name of the active comment marker.
|
|
34
|
+
*
|
|
35
|
+
* Markers conversion checks if comment should be marked as active and adds/removes additional css class during the conversion.
|
|
36
|
+
*
|
|
37
|
+
* @observable
|
|
38
|
+
*/
|
|
39
|
+
activeMarker: string | null;
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
*/
|
|
43
|
+
static get requires(): readonly [typeof CommentsRepository, typeof EditorAnnotations, typeof CommentsRestrictedEditingMode, typeof CommentsImportWord];
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
static get pluginName(): "CommentsEditing";
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
constructor(editor: Editor);
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
init(): void;
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
destroy(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Returns `true` if there is at least one marker in the content that is related to a comment thread with given `threadId`.
|
|
62
|
+
*
|
|
63
|
+
* @param threadId Comment thread id.
|
|
64
|
+
*/
|
|
65
|
+
hasMarkerForId(threadId: string): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Returns all markers that are related to the comment thread with the given `threadId`.
|
|
68
|
+
*
|
|
69
|
+
* @param threadId Comment thread id.
|
|
70
|
+
* @returns Array with all markers related to given comment thread.
|
|
71
|
+
*/
|
|
72
|
+
getAllMarkersForId(threadId: string): Array<Marker>;
|
|
73
|
+
/**
|
|
74
|
+
* Scrolls editing view to the first thread marker.
|
|
75
|
+
*
|
|
76
|
+
* @param threadId Comment thread id.
|
|
77
|
+
*/
|
|
78
|
+
scrollToThreadMarker(threadId: string): void;
|
|
79
|
+
}
|