@ckeditor/ckeditor5-mention 48.2.0 → 48.3.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.
@@ -1,108 +1,108 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module mention/mentionui
7
- */
8
- import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
9
- import { ContextualBalloon } from '@ckeditor/ckeditor5-ui';
6
+ * @module mention/mentionui
7
+ */
8
+ import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { ContextualBalloon } from "@ckeditor/ckeditor5-ui";
10
10
  /**
11
- * The mention UI feature.
12
- */
11
+ * The mention UI feature.
12
+ */
13
13
  export declare class MentionUI extends Plugin {
14
- /**
15
- * The mention view.
16
- */
17
- private readonly _mentionsView;
18
- /**
19
- * Stores mention feeds configurations.
20
- */
21
- private _mentionsConfigurations;
22
- /**
23
- * The contextual balloon plugin instance.
24
- */
25
- private _balloon;
26
- private _items;
27
- private _lastRequested?;
28
- /**
29
- * Debounced feed requester. It uses `es-toolkit#debounce` method to delay function call.
30
- */
31
- private _requestFeedDebounced;
32
- /**
33
- * @inheritDoc
34
- */
35
- static get pluginName(): "MentionUI";
36
- /**
37
- * @inheritDoc
38
- */
39
- static get isOfficialPlugin(): true;
40
- /**
41
- * @inheritDoc
42
- */
43
- static get requires(): readonly [typeof ContextualBalloon];
44
- /**
45
- * @inheritDoc
46
- */
47
- constructor(editor: Editor);
48
- /**
49
- * @inheritDoc
50
- */
51
- init(): void;
52
- /**
53
- * @inheritDoc
54
- */
55
- destroy(): void;
56
- /**
57
- * Returns true when {@link #_mentionsView} is in the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon} and it is
58
- * currently visible.
59
- */
60
- private get _isUIVisible();
61
- /**
62
- * Creates the {@link #_mentionsView}.
63
- */
64
- private _createMentionView;
65
- /**
66
- * Returns item renderer for the marker.
67
- */
68
- private _getItemRenderer;
69
- /**
70
- * Requests a feed from a configured callbacks.
71
- */
72
- private _requestFeed;
73
- /**
74
- * Registers a text watcher for the marker.
75
- */
76
- private _setupTextWatcher;
77
- /**
78
- * Handles the feed response event data.
79
- */
80
- private _handleFeedResponse;
81
- /**
82
- * Shows the mentions balloon. If the panel is already visible, it will reposition it.
83
- */
84
- private _showOrUpdateUI;
85
- /**
86
- * Hides the mentions balloon and removes the 'mention' marker from the markers collection.
87
- */
88
- private _hideUIAndRemoveMarker;
89
- /**
90
- * Renders a single item in the autocomplete list.
91
- */
92
- private _renderItem;
93
- /**
94
- * Creates a position options object used to position the balloon panel.
95
- *
96
- * @param mentionMarker
97
- * @param preferredPosition The name of the last matched position name.
98
- */
99
- private _getBalloonPanelPositionData;
14
+ /**
15
+ * The mention view.
16
+ */
17
+ private readonly _mentionsView;
18
+ /**
19
+ * Stores mention feeds configurations.
20
+ */
21
+ private _mentionsConfigurations;
22
+ /**
23
+ * The contextual balloon plugin instance.
24
+ */
25
+ private _balloon;
26
+ private _items;
27
+ private _lastRequested?;
28
+ /**
29
+ * Debounced feed requester. It uses `es-toolkit#debounce` method to delay function call.
30
+ */
31
+ private _requestFeedDebounced;
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static get pluginName(): "MentionUI";
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ static override get isOfficialPlugin(): true;
40
+ /**
41
+ * @inheritDoc
42
+ */
43
+ static get requires(): PluginDependenciesOf<[ContextualBalloon]>;
44
+ /**
45
+ * @inheritDoc
46
+ */
47
+ constructor(editor: Editor);
48
+ /**
49
+ * @inheritDoc
50
+ */
51
+ init(): void;
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ override destroy(): void;
56
+ /**
57
+ * Returns true when {@link #_mentionsView} is in the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon} and it is
58
+ * currently visible.
59
+ */
60
+ private get _isUIVisible();
61
+ /**
62
+ * Creates the {@link #_mentionsView}.
63
+ */
64
+ private _createMentionView;
65
+ /**
66
+ * Returns item renderer for the marker.
67
+ */
68
+ private _getItemRenderer;
69
+ /**
70
+ * Requests a feed from a configured callbacks.
71
+ */
72
+ private _requestFeed;
73
+ /**
74
+ * Registers a text watcher for the marker.
75
+ */
76
+ private _setupTextWatcher;
77
+ /**
78
+ * Handles the feed response event data.
79
+ */
80
+ private _handleFeedResponse;
81
+ /**
82
+ * Shows the mentions balloon. If the panel is already visible, it will reposition it.
83
+ */
84
+ private _showOrUpdateUI;
85
+ /**
86
+ * Hides the mentions balloon and removes the 'mention' marker from the markers collection.
87
+ */
88
+ private _hideUIAndRemoveMarker;
89
+ /**
90
+ * Renders a single item in the autocomplete list.
91
+ */
92
+ private _renderItem;
93
+ /**
94
+ * Creates a position options object used to position the balloon panel.
95
+ *
96
+ * @param mentionMarker
97
+ * @param preferredPosition The name of the last matched position name.
98
+ */
99
+ private _getBalloonPanelPositionData;
100
100
  }
101
101
  /**
102
- * Creates a RegExp pattern for the marker.
103
- *
104
- * Function has to be exported to achieve 100% code coverage.
105
- *
106
- * @internal
107
- */
102
+ * Creates a RegExp pattern for the marker.
103
+ *
104
+ * Function has to be exported to achieve 100% code coverage.
105
+ *
106
+ * @internal
107
+ */
108
108
  export declare function createRegExp(marker: string, minimumCharacters: number): RegExp;
@@ -1,41 +1,41 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module mention/ui/domwrapperview
7
- */
8
- import { View } from '@ckeditor/ckeditor5-ui';
9
- import type { Locale } from '@ckeditor/ckeditor5-utils';
6
+ * @module mention/ui/domwrapperview
7
+ */
8
+ import { View } from "@ckeditor/ckeditor5-ui";
9
+ import type { Locale } from "@ckeditor/ckeditor5-utils";
10
10
  /**
11
- * This class wraps DOM element as a CKEditor5 UI View.
12
- *
13
- * It allows to render any DOM element and use it in mentions list.
14
- */
11
+ * This class wraps DOM element as a CKEditor5 UI View.
12
+ *
13
+ * It allows to render any DOM element and use it in mentions list.
14
+ */
15
15
  export declare class MentionDomWrapperView extends View {
16
- /**
17
- * The DOM element for which wrapper was created.
18
- */
19
- domElement: HTMLElement;
20
- /**
21
- * Controls whether the dom wrapper view is "on". This is in line with {@link module:ui/button/button~Button#isOn} property.
22
- *
23
- * @observable
24
- * @default true
25
- */
26
- isOn: boolean;
27
- /**
28
- * Creates an instance of {@link module:mention/ui/domwrapperview~MentionDomWrapperView} class.
29
- *
30
- * Also see {@link #render}.
31
- */
32
- constructor(locale: Locale, domElement: HTMLElement);
33
- /**
34
- * @inheritDoc
35
- */
36
- render(): void;
37
- /**
38
- * Focuses the DOM element.
39
- */
40
- focus(): void;
16
+ /**
17
+ * The DOM element for which wrapper was created.
18
+ */
19
+ domElement: HTMLElement;
20
+ /**
21
+ * Controls whether the dom wrapper view is "on". This is in line with {@link module:ui/button/button~Button#isOn} property.
22
+ *
23
+ * @observable
24
+ * @default true
25
+ */
26
+ isOn: boolean;
27
+ /**
28
+ * Creates an instance of {@link module:mention/ui/domwrapperview~MentionDomWrapperView} class.
29
+ *
30
+ * Also see {@link #render}.
31
+ */
32
+ constructor(locale: Locale, domElement: HTMLElement);
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ override render(): void;
37
+ /**
38
+ * Focuses the DOM element.
39
+ */
40
+ focus(): void;
41
41
  }
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module mention/ui/mentionlistitemview
7
- */
8
- import { ListItemView } from '@ckeditor/ckeditor5-ui';
9
- import type { MentionFeedItem } from '../mentionconfig.js';
6
+ * @module mention/ui/mentionlistitemview
7
+ */
8
+ import { ListItemView } from "@ckeditor/ckeditor5-ui";
9
+ import type { MentionFeedItem } from "../mentionconfig.js";
10
10
  export declare class MentionListItemView extends ListItemView {
11
- item: MentionFeedItem;
12
- marker: string;
13
- highlight(): void;
14
- removeHighlight(): void;
11
+ item: MentionFeedItem;
12
+ marker: string;
13
+ highlight(): void;
14
+ removeHighlight(): void;
15
15
  }
@@ -1,60 +1,60 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module mention/ui/mentionsview
7
- */
8
- import { ListView } from '@ckeditor/ckeditor5-ui';
9
- import { type Locale } from '@ckeditor/ckeditor5-utils';
10
- import { type MentionListItemView } from './mentionlistitemview.js';
11
- import '../../theme/mentionui.css';
6
+ * @module mention/ui/mentionsview
7
+ */
8
+ import { ListView } from "@ckeditor/ckeditor5-ui";
9
+ import { type Locale } from "@ckeditor/ckeditor5-utils";
10
+ import { type MentionListItemView } from "./mentionlistitemview.js";
11
+ import "../../theme/mentionui.css";
12
12
  /**
13
- * The mention ui view.
14
- */
13
+ * The mention ui view.
14
+ */
15
15
  export declare class MentionsView extends ListView {
16
- selected: MentionListItemView | undefined;
17
- position: string | undefined;
18
- /**
19
- * @inheritDoc
20
- */
21
- constructor(locale: Locale);
22
- /**
23
- * {@link #select Selects} the first item.
24
- */
25
- selectFirst(): void;
26
- /**
27
- * Selects next item to the currently {@link #select selected}.
28
- *
29
- * If the last item is already selected, it will select the first item.
30
- */
31
- selectNext(): void;
32
- /**
33
- * Selects previous item to the currently {@link #select selected}.
34
- *
35
- * If the first item is already selected, it will select the last item.
36
- */
37
- selectPrevious(): void;
38
- /**
39
- * Marks item at a given index as selected.
40
- *
41
- * Handles selection cycling when passed index is out of bounds:
42
- * - if the index is lower than 0, it will select the last item,
43
- * - if the index is higher than the last item index, it will select the first item.
44
- *
45
- * @param index Index of an item to be marked as selected.
46
- */
47
- select(index: number): void;
48
- /**
49
- * Triggers the `execute` event on the {@link #select selected} item.
50
- */
51
- executeSelected(): void;
52
- /**
53
- * Checks if an item is visible in the scrollable area.
54
- *
55
- * The item is considered visible when:
56
- * - its top boundary is inside the scrollable rect
57
- * - its bottom boundary is inside the scrollable rect (the whole item must be visible)
58
- */
59
- private _isItemVisibleInScrolledArea;
16
+ selected: MentionListItemView | undefined;
17
+ position: string | undefined;
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ constructor(locale: Locale);
22
+ /**
23
+ * {@link #select Selects} the first item.
24
+ */
25
+ selectFirst(): void;
26
+ /**
27
+ * Selects next item to the currently {@link #select selected}.
28
+ *
29
+ * If the last item is already selected, it will select the first item.
30
+ */
31
+ selectNext(): void;
32
+ /**
33
+ * Selects previous item to the currently {@link #select selected}.
34
+ *
35
+ * If the first item is already selected, it will select the last item.
36
+ */
37
+ selectPrevious(): void;
38
+ /**
39
+ * Marks item at a given index as selected.
40
+ *
41
+ * Handles selection cycling when passed index is out of bounds:
42
+ * - if the index is lower than 0, it will select the last item,
43
+ * - if the index is higher than the last item index, it will select the first item.
44
+ *
45
+ * @param index Index of an item to be marked as selected.
46
+ */
47
+ select(index: number): void;
48
+ /**
49
+ * Triggers the `execute` event on the {@link #select selected} item.
50
+ */
51
+ executeSelected(): void;
52
+ /**
53
+ * Checks if an item is visible in the scrollable area.
54
+ *
55
+ * The item is considered visible when:
56
+ * - its top boundary is inside the scrollable rect
57
+ * - its bottom boundary is inside the scrollable rect (the whole item must be visible)
58
+ */
59
+ private _isItemVisibleInScrolledArea;
60
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-mention",
3
- "version": "48.2.0",
3
+ "version": "48.3.0-alpha.1",
4
4
  "description": "Mention feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -26,11 +26,11 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@ckeditor/ckeditor5-core": "48.2.0",
30
- "@ckeditor/ckeditor5-engine": "48.2.0",
31
- "@ckeditor/ckeditor5-typing": "48.2.0",
32
- "@ckeditor/ckeditor5-ui": "48.2.0",
33
- "@ckeditor/ckeditor5-utils": "48.2.0",
29
+ "@ckeditor/ckeditor5-core": "48.3.0-alpha.1",
30
+ "@ckeditor/ckeditor5-engine": "48.3.0-alpha.1",
31
+ "@ckeditor/ckeditor5-typing": "48.3.0-alpha.1",
32
+ "@ckeditor/ckeditor5-ui": "48.3.0-alpha.1",
33
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.1",
34
34
  "es-toolkit": "1.45.1"
35
35
  },
36
36
  "files": [