@ckeditor/ckeditor5-mention 37.0.0-alpha.0 → 37.0.0-alpha.2

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-mention",
3
- "version": "37.0.0-alpha.0",
3
+ "version": "37.0.0-alpha.2",
4
4
  "description": "Mention feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,28 +12,28 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "^37.0.0-alpha.0",
15
+ "ckeditor5": "^37.0.0-alpha.2",
16
16
  "lodash-es": "^4.17.15"
17
17
  },
18
18
  "devDependencies": {
19
- "@ckeditor/ckeditor5-basic-styles": "^37.0.0-alpha.0",
20
- "@ckeditor/ckeditor5-block-quote": "^37.0.0-alpha.0",
21
- "@ckeditor/ckeditor5-clipboard": "^37.0.0-alpha.0",
22
- "@ckeditor/ckeditor5-cloud-services": "^37.0.0-alpha.0",
23
- "@ckeditor/ckeditor5-core": "^37.0.0-alpha.0",
24
- "@ckeditor/ckeditor5-dev-utils": "^34.0.0",
25
- "@ckeditor/ckeditor5-editor-classic": "^37.0.0-alpha.0",
26
- "@ckeditor/ckeditor5-engine": "^37.0.0-alpha.0",
27
- "@ckeditor/ckeditor5-font": "^37.0.0-alpha.0",
28
- "@ckeditor/ckeditor5-link": "^37.0.0-alpha.0",
29
- "@ckeditor/ckeditor5-paragraph": "^37.0.0-alpha.0",
30
- "@ckeditor/ckeditor5-table": "^37.0.0-alpha.0",
31
- "@ckeditor/ckeditor5-theme-lark": "^37.0.0-alpha.0",
32
- "@ckeditor/ckeditor5-typing": "^37.0.0-alpha.0",
33
- "@ckeditor/ckeditor5-ui": "^37.0.0-alpha.0",
34
- "@ckeditor/ckeditor5-undo": "^37.0.0-alpha.0",
35
- "@ckeditor/ckeditor5-utils": "^37.0.0-alpha.0",
36
- "@ckeditor/ckeditor5-widget": "^37.0.0-alpha.0",
19
+ "@ckeditor/ckeditor5-basic-styles": "^37.0.0-alpha.2",
20
+ "@ckeditor/ckeditor5-block-quote": "^37.0.0-alpha.2",
21
+ "@ckeditor/ckeditor5-clipboard": "^37.0.0-alpha.2",
22
+ "@ckeditor/ckeditor5-cloud-services": "^37.0.0-alpha.2",
23
+ "@ckeditor/ckeditor5-core": "^37.0.0-alpha.2",
24
+ "@ckeditor/ckeditor5-dev-utils": "^35.0.0",
25
+ "@ckeditor/ckeditor5-editor-classic": "^37.0.0-alpha.2",
26
+ "@ckeditor/ckeditor5-engine": "^37.0.0-alpha.2",
27
+ "@ckeditor/ckeditor5-font": "^37.0.0-alpha.2",
28
+ "@ckeditor/ckeditor5-link": "^37.0.0-alpha.2",
29
+ "@ckeditor/ckeditor5-paragraph": "^37.0.0-alpha.2",
30
+ "@ckeditor/ckeditor5-table": "^37.0.0-alpha.2",
31
+ "@ckeditor/ckeditor5-theme-lark": "^37.0.0-alpha.2",
32
+ "@ckeditor/ckeditor5-typing": "^37.0.0-alpha.2",
33
+ "@ckeditor/ckeditor5-ui": "^37.0.0-alpha.2",
34
+ "@ckeditor/ckeditor5-undo": "^37.0.0-alpha.2",
35
+ "@ckeditor/ckeditor5-utils": "^37.0.0-alpha.2",
36
+ "@ckeditor/ckeditor5-widget": "^37.0.0-alpha.2",
37
37
  "lodash": "^4.17.15",
38
38
  "typescript": "^4.8.4",
39
39
  "webpack": "^5.58.1",
@@ -63,7 +63,7 @@
63
63
  ],
64
64
  "scripts": {
65
65
  "dll:build": "webpack",
66
- "build": "tsc -p ./tsconfig.release.json",
66
+ "build": "tsc -p ./tsconfig.json",
67
67
  "postversion": "npm run build"
68
68
  },
69
69
  "types": "src/index.d.ts"
@@ -0,0 +1,23 @@
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 { MentionConfig, Mention, MentionEditing, MentionUI, MentionCommand } from './index';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface EditorConfig {
8
+ /**
9
+ * The configuration of the {@link module:mention/mention~Mention} feature.
10
+ *
11
+ * Read more in {@link module:mention/mentionconfig~MentionConfig}.
12
+ */
13
+ mention?: MentionConfig;
14
+ }
15
+ interface PluginsMap {
16
+ [Mention.pluginName]: Mention;
17
+ [MentionEditing.pluginName]: MentionEditing;
18
+ [MentionUI.pluginName]: MentionUI;
19
+ }
20
+ interface CommandsMap {
21
+ mention: MentionCommand;
22
+ }
23
+ }
@@ -0,0 +1,5 @@
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
+ export {};
package/src/index.d.ts CHANGED
@@ -8,3 +8,6 @@
8
8
  export { default as Mention } from './mention';
9
9
  export { default as MentionEditing } from './mentionediting';
10
10
  export { default as MentionUI } from './mentionui';
11
+ export type { MentionConfig } from './mentionconfig';
12
+ export type { default as MentionCommand } from './mentioncommand';
13
+ import './augmentation';
package/src/index.js CHANGED
@@ -8,3 +8,4 @@
8
8
  export { default as Mention } from './mention';
9
9
  export { default as MentionEditing } from './mentionediting';
10
10
  export { default as MentionUI } from './mentionui';
11
+ import './augmentation';
package/src/mention.d.ts CHANGED
@@ -62,8 +62,3 @@ export type MentionAttribute = {
62
62
  */
63
63
  _text?: string;
64
64
  };
65
- declare module '@ckeditor/ckeditor5-core' {
66
- interface PluginsMap {
67
- [Mention.pluginName]: Mention;
68
- }
69
- }
@@ -69,8 +69,3 @@ export default class MentionCommand extends Command {
69
69
  range?: Range;
70
70
  }): void;
71
71
  }
72
- declare module '@ckeditor/ckeditor5-core' {
73
- interface CommandsMap {
74
- mention: MentionCommand;
75
- }
76
- }
@@ -195,9 +195,9 @@ export interface MentionFeed {
195
195
  */
196
196
  export type FeedCallback = (searchString: string) => Array<MentionFeedItem> | Promise<Array<MentionFeedItem>>;
197
197
  /**
198
- * Function that takes renders a {@link module:mention/mentionconfig~MentionFeedItem} as HTMLElement.
198
+ * Function that takes renders a {@link module:mention/mentionconfig~MentionFeedObjectItem} as HTMLElement.
199
199
  */
200
- export type ItemRenderer = (item: MentionFeedItem) => HTMLElement;
200
+ export type ItemRenderer = (item: MentionFeedObjectItem) => HTMLElement | string;
201
201
  /**
202
202
  * The mention feed item. It may be defined as a string or a plain object.
203
203
  *
@@ -261,15 +261,5 @@ export type MentionFeedObjectItem = {
261
261
  /**
262
262
  * Text inserted into the editor when creating a mention.
263
263
  */
264
- text: string;
264
+ text?: string;
265
265
  };
266
- declare module '@ckeditor/ckeditor5-core' {
267
- interface EditorConfig {
268
- /**
269
- * The configuration of the {@link module:mention/mention~Mention} feature.
270
- *
271
- * Read more in {@link module:mention/mentionconfig~MentionConfig}.
272
- */
273
- mention?: MentionConfig;
274
- }
275
- }
@@ -38,8 +38,3 @@ export declare function _addMentionAttributes(baseMentionData: MentionAttribute,
38
38
  * @internal
39
39
  */
40
40
  export declare function _toMentionAttribute(viewElementOrMention: Element, data?: MentionAttribute): MentionAttribute | undefined;
41
- declare module '@ckeditor/ckeditor5-core' {
42
- interface PluginsMap {
43
- [MentionEditing.pluginName]: MentionEditing;
44
- }
45
- }
@@ -63,10 +63,6 @@ export default class MentionUI extends Plugin {
63
63
  private _getItemRenderer;
64
64
  /**
65
65
  * Requests a feed from a configured callbacks.
66
- *
67
- * @fires response
68
- * @fires discarded
69
- * @fires error
70
66
  */
71
67
  private _requestFeed;
72
68
  /**
@@ -103,8 +99,3 @@ export default class MentionUI extends Plugin {
103
99
  * Function has to be exported to achieve 100% code coverage.
104
100
  */
105
101
  export declare function createRegExp(marker: string, minimumCharacters: number): RegExp;
106
- declare module '@ckeditor/ckeditor5-core' {
107
- interface PluginsMap {
108
- [MentionUI.pluginName]: MentionUI;
109
- }
110
- }
package/src/mentionui.js CHANGED
@@ -195,10 +195,6 @@ export default class MentionUI extends Plugin {
195
195
  }
196
196
  /**
197
197
  * Requests a feed from a configured callbacks.
198
- *
199
- * @fires response
200
- * @fires discarded
201
- * @fires error
202
198
  */
203
199
  _requestFeed(marker, feedText) {
204
200
  // @if CK_DEBUG_MENTION // console.log( '%c[Feed]%c Requesting for', 'color: blue', 'color: black', `"${ feedText }"` );