@ckeditor/ckeditor5-link 48.2.0 → 48.3.0-alpha.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/dist/augmentation.d.ts +28 -28
- package/dist/autolink.d.ts +74 -74
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +29 -29
- package/dist/index.js +3014 -3524
- package/dist/index.js.map +1 -1
- package/dist/link.d.ts +26 -26
- package/dist/linkcommand.d.ts +134 -134
- package/dist/linkconfig.d.ts +313 -313
- package/dist/linkediting.d.ts +88 -88
- package/dist/linkimage.d.ts +26 -26
- package/dist/linkimageediting.d.ts +39 -39
- package/dist/linkimageui.d.ts +41 -41
- package/dist/linkui.d.ts +350 -350
- package/dist/ui/linkbuttonview.d.ts +27 -27
- package/dist/ui/linkformview.d.ts +141 -141
- package/dist/ui/linkpreviewbuttonview.d.ts +27 -27
- package/dist/ui/linkpropertiesview.d.ts +80 -80
- package/dist/ui/linkprovideritemsview.d.ts +106 -106
- package/dist/unlinkcommand.d.ts +26 -26
- package/dist/utils/automaticdecorators.d.ts +54 -54
- package/dist/utils/conflictingdecorators.d.ts +32 -32
- package/dist/utils/manualdecorator.d.ts +59 -62
- package/dist/utils.d.ts +62 -62
- package/package.json +11 -11
package/dist/linkui.d.ts
CHANGED
|
@@ -1,364 +1,364 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { ContextualBalloon, ToolbarView, type ViewWithCssTransitionDisabler } from
|
|
10
|
-
import { LinkEditing } from
|
|
11
|
-
import { LinkFormView } from
|
|
12
|
-
import { LinkProviderItemsView } from
|
|
13
|
-
import { LinkPropertiesView } from
|
|
14
|
-
import
|
|
6
|
+
* @module link/linkui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { ContextualBalloon, ToolbarView, type ViewWithCssTransitionDisabler } from "@ckeditor/ckeditor5-ui";
|
|
10
|
+
import { LinkEditing } from "./linkediting.js";
|
|
11
|
+
import { LinkFormView } from "./ui/linkformview.js";
|
|
12
|
+
import { LinkProviderItemsView } from "./ui/linkprovideritemsview.js";
|
|
13
|
+
import { LinkPropertiesView } from "./ui/linkpropertiesview.js";
|
|
14
|
+
import "../theme/linktoolbar.css";
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
* The link UI plugin. It introduces the `'link'` and `'unlink'` buttons and support for the <kbd>Ctrl+K</kbd> keystroke.
|
|
17
|
+
*
|
|
18
|
+
* It uses the
|
|
19
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
|
|
20
|
+
*/
|
|
21
21
|
export declare class LinkUI extends Plugin {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The toolbar view displayed inside of the balloon.
|
|
24
|
+
*/
|
|
25
|
+
toolbarView: ToolbarView | null;
|
|
26
|
+
/**
|
|
27
|
+
* The form view displayed inside the balloon.
|
|
28
|
+
*/
|
|
29
|
+
formView: LinkFormView & ViewWithCssTransitionDisabler | null;
|
|
30
|
+
/**
|
|
31
|
+
* The view displaying links list.
|
|
32
|
+
*/
|
|
33
|
+
linkProviderItemsView: LinkProviderItemsView | null;
|
|
34
|
+
/**
|
|
35
|
+
* The form view displaying properties link settings.
|
|
36
|
+
*/
|
|
37
|
+
propertiesView: LinkPropertiesView & ViewWithCssTransitionDisabler | null;
|
|
38
|
+
/**
|
|
39
|
+
* The selected text of the link or text that is selected and can become a link.
|
|
40
|
+
*
|
|
41
|
+
* Note: It is `undefined` when the current selection does not allow for text,
|
|
42
|
+
* for example any non text node is selected or multiple blocks are selected.
|
|
43
|
+
*
|
|
44
|
+
* @observable
|
|
45
|
+
* @readonly
|
|
46
|
+
*/
|
|
47
|
+
selectedLinkableText: string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The contextual balloon plugin instance.
|
|
50
|
+
*/
|
|
51
|
+
private _balloon;
|
|
52
|
+
/**
|
|
53
|
+
* The collection of the link providers.
|
|
54
|
+
*/
|
|
55
|
+
private _linksProviders;
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
static get requires(): PluginDependenciesOf<[ContextualBalloon, LinkEditing]>;
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
static get pluginName(): "LinkUI";
|
|
64
|
+
/**
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
static override get isOfficialPlugin(): true;
|
|
68
|
+
/**
|
|
69
|
+
* @inheritDoc
|
|
70
|
+
*/
|
|
71
|
+
init(): void;
|
|
72
|
+
/**
|
|
73
|
+
* @inheritDoc
|
|
74
|
+
*/
|
|
75
|
+
override destroy(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Registers list of buttons below the link form view that
|
|
78
|
+
* open a list of links provided by the clicked provider.
|
|
79
|
+
*/
|
|
80
|
+
registerLinksListProvider(provider: LinksProvider): void;
|
|
81
|
+
/**
|
|
82
|
+
* Creates views.
|
|
83
|
+
*/
|
|
84
|
+
private _createViews;
|
|
85
|
+
/**
|
|
86
|
+
* Creates the ToolbarView instance.
|
|
87
|
+
*/
|
|
88
|
+
private _createToolbarView;
|
|
89
|
+
/**
|
|
90
|
+
* Creates the {@link module:link/ui/linkformview~LinkFormView} instance.
|
|
91
|
+
*/
|
|
92
|
+
private _createFormView;
|
|
93
|
+
/**
|
|
94
|
+
* Creates a sorted array of buttons with link names.
|
|
95
|
+
*/
|
|
96
|
+
private _createLinkProviderListView;
|
|
97
|
+
/**
|
|
98
|
+
* Creates a view for links provider.
|
|
99
|
+
*/
|
|
100
|
+
private _createLinkProviderItemsView;
|
|
101
|
+
/**
|
|
102
|
+
* Creates the {@link module:link/ui/linkpropertiesview~LinkPropertiesView} instance.
|
|
103
|
+
*/
|
|
104
|
+
private _createPropertiesView;
|
|
105
|
+
/**
|
|
106
|
+
* Obtains the state of the manual decorators.
|
|
107
|
+
*/
|
|
108
|
+
private _getDecoratorSwitchesState;
|
|
109
|
+
/**
|
|
110
|
+
* Registers listeners used in editing plugin, used to open links.
|
|
111
|
+
*/
|
|
112
|
+
private _registerEditingOpeners;
|
|
113
|
+
/**
|
|
114
|
+
* Registers components in the ComponentFactory.
|
|
115
|
+
*/
|
|
116
|
+
private _registerComponents;
|
|
117
|
+
/**
|
|
118
|
+
* Creates a links button view.
|
|
119
|
+
*/
|
|
120
|
+
private _createLinksListProviderButton;
|
|
121
|
+
/**
|
|
122
|
+
* Creates a button for link command to use either in toolbar or in menu bar.
|
|
123
|
+
*/
|
|
124
|
+
private _createButton;
|
|
125
|
+
/**
|
|
126
|
+
* Attaches actions that control whether the balloon panel containing the
|
|
127
|
+
* {@link #formView} should be displayed.
|
|
128
|
+
*/
|
|
129
|
+
private _enableBalloonActivators;
|
|
130
|
+
/**
|
|
131
|
+
* Attaches actions that control whether the balloon panel containing the
|
|
132
|
+
* {@link #formView} is visible or not.
|
|
133
|
+
*/
|
|
134
|
+
private _enableUserBalloonInteractions;
|
|
135
|
+
/**
|
|
136
|
+
* Adds the {@link #toolbarView} to the {@link #_balloon}.
|
|
137
|
+
*
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
_addToolbarView(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Adds the {@link #formView} to the {@link #_balloon}.
|
|
143
|
+
*/
|
|
144
|
+
private _addFormView;
|
|
145
|
+
/**
|
|
146
|
+
* Adds the {@link #propertiesView} to the {@link #_balloon}.
|
|
147
|
+
*/
|
|
148
|
+
private _addPropertiesView;
|
|
149
|
+
/**
|
|
150
|
+
* Shows the view with links provided by the given provider.
|
|
151
|
+
*/
|
|
152
|
+
private _showLinksProviderView;
|
|
153
|
+
/**
|
|
154
|
+
* Adds the {@link #linkProviderItemsView} to the {@link #_balloon}.
|
|
155
|
+
*/
|
|
156
|
+
private _addLinkProviderItemsView;
|
|
157
|
+
/**
|
|
158
|
+
* Closes the form view. Decides whether the balloon should be hidden completely or if the action view should be shown. This is
|
|
159
|
+
* decided upon the link command value (which has a value if the document selection is in the link).
|
|
160
|
+
*/
|
|
161
|
+
private _closeFormView;
|
|
162
|
+
/**
|
|
163
|
+
* Removes the {@link #propertiesView} from the {@link #_balloon}.
|
|
164
|
+
*/
|
|
165
|
+
private _removePropertiesView;
|
|
166
|
+
/**
|
|
167
|
+
* Removes the {@link #linkProviderItemsView} from the {@link #_balloon}.
|
|
168
|
+
*/
|
|
169
|
+
private _removeLinksProviderView;
|
|
170
|
+
/**
|
|
171
|
+
* Removes the {@link #formView} from the {@link #_balloon}.
|
|
172
|
+
*/
|
|
173
|
+
private _removeFormView;
|
|
174
|
+
/**
|
|
175
|
+
* Shows the correct UI type. It is either {@link #formView} or {@link #toolbarView}.
|
|
176
|
+
*
|
|
177
|
+
* @internal
|
|
178
|
+
*/
|
|
179
|
+
_showUI(forceVisible?: boolean): void;
|
|
180
|
+
/**
|
|
181
|
+
* Removes the {@link #formView} from the {@link #_balloon}.
|
|
182
|
+
*
|
|
183
|
+
* See {@link #_addFormView}, {@link #_addToolbarView}.
|
|
184
|
+
*/
|
|
185
|
+
private _hideUI;
|
|
186
|
+
/**
|
|
187
|
+
* Makes the UI react to the {@link module:ui/editorui/editorui~EditorUI#event:update} event to
|
|
188
|
+
* reposition itself when the editor UI should be refreshed.
|
|
189
|
+
*
|
|
190
|
+
* See: {@link #_hideUI} to learn when the UI stops reacting to the `update` event.
|
|
191
|
+
*/
|
|
192
|
+
private _startUpdatingUI;
|
|
193
|
+
/**
|
|
194
|
+
* Returns `true` when {@link #propertiesView} is in the {@link #_balloon}.
|
|
195
|
+
*/
|
|
196
|
+
private get _arePropertiesInPanel();
|
|
197
|
+
/**
|
|
198
|
+
* Returns `true` when {@link #linkProviderItemsView} is in the {@link #_balloon}.
|
|
199
|
+
*/
|
|
200
|
+
private get _isLinksListInPanel();
|
|
201
|
+
/**
|
|
202
|
+
* Returns `true` when {@link #formView} is in the {@link #_balloon}.
|
|
203
|
+
*/
|
|
204
|
+
private get _isFormInPanel();
|
|
205
|
+
/**
|
|
206
|
+
* Returns `true` when {@link #toolbarView} is in the {@link #_balloon}.
|
|
207
|
+
*/
|
|
208
|
+
private get _isToolbarInPanel();
|
|
209
|
+
/**
|
|
210
|
+
* Returns `true` when {@link #propertiesView} is in the {@link #_balloon} and it is
|
|
211
|
+
* currently visible.
|
|
212
|
+
*/
|
|
213
|
+
private get _isPropertiesVisible();
|
|
214
|
+
/**
|
|
215
|
+
* Returns `true` when {@link #formView} is in the {@link #_balloon} and it is
|
|
216
|
+
* currently visible.
|
|
217
|
+
*/
|
|
218
|
+
private get _isFormVisible();
|
|
219
|
+
/**
|
|
220
|
+
* Returns `true` when {@link #toolbarView} is in the {@link #_balloon} and it is
|
|
221
|
+
* currently visible.
|
|
222
|
+
*/
|
|
223
|
+
private get _isToolbarVisible();
|
|
224
|
+
/**
|
|
225
|
+
* Returns `true` when {@link #propertiesView}, {@link #toolbarView}, {@link #linkProviderItemsView}
|
|
226
|
+
* or {@link #formView} is in the {@link #_balloon}.
|
|
227
|
+
*/
|
|
228
|
+
private get _isUIInPanel();
|
|
229
|
+
/**
|
|
230
|
+
* Returns `true` when {@link #propertiesView}, {@link #linkProviderItemsView}, {@link #toolbarView}
|
|
231
|
+
* or {@link #formView} is in the {@link #_balloon} and it is currently visible.
|
|
232
|
+
*/
|
|
233
|
+
private get _isUIVisible();
|
|
234
|
+
/**
|
|
235
|
+
* Returns positioning options for the {@link #_balloon}. They control the way the balloon is attached
|
|
236
|
+
* to the target element or selection.
|
|
237
|
+
*
|
|
238
|
+
* If the selection is collapsed and inside a link element, the panel will be attached to the
|
|
239
|
+
* entire link element. Otherwise, it will be attached to the selection.
|
|
240
|
+
*/
|
|
241
|
+
private _getBalloonPositionData;
|
|
242
|
+
/**
|
|
243
|
+
* Returns the link {@link module:engine/view/attributeelement~ViewAttributeElement} under
|
|
244
|
+
* the {@link module:engine/view/document~ViewDocument editing view's} selection or `null`
|
|
245
|
+
* if there is none.
|
|
246
|
+
*
|
|
247
|
+
* **Note**: For a non–collapsed selection, the link element is returned when **fully**
|
|
248
|
+
* selected and the **only** element within the selection boundaries, or when
|
|
249
|
+
* a linked widget is selected.
|
|
250
|
+
*/
|
|
251
|
+
private _getSelectedLinkElement;
|
|
252
|
+
/**
|
|
253
|
+
* Returns selected link text content.
|
|
254
|
+
* If link is not selected it returns the selected text.
|
|
255
|
+
* If selection or link includes non text node (inline object or block) then returns undefined.
|
|
256
|
+
*/
|
|
257
|
+
private _getSelectedLinkableText;
|
|
258
|
+
/**
|
|
259
|
+
* Returns a provider by its URL.
|
|
260
|
+
*
|
|
261
|
+
* @param href URL of the link.
|
|
262
|
+
* @returns Link provider and item or `null` if not found.
|
|
263
|
+
*/
|
|
264
|
+
private _getLinkProviderLinkByHref;
|
|
265
|
+
/**
|
|
266
|
+
* Displays a fake visual selection when the contextual balloon is displayed.
|
|
267
|
+
*
|
|
268
|
+
* This adds a 'link-ui' marker into the document that is rendered as a highlight on selected text fragment.
|
|
269
|
+
*/
|
|
270
|
+
private _showFakeVisualSelection;
|
|
271
|
+
/**
|
|
272
|
+
* Hides the fake visual selection created in {@link #_showFakeVisualSelection}.
|
|
273
|
+
*/
|
|
274
|
+
private _hideFakeVisualSelection;
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
* Link list item that represents a single link in the provider's list.
|
|
278
|
+
* It's displayed after the user clicks the button that opens the list in the link form view.
|
|
279
|
+
*/
|
|
280
280
|
export type LinksProviderListItem = {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
281
|
+
/**
|
|
282
|
+
* Unique identifier of the item. Avoids collection malfunction when there are links with the same labels.
|
|
283
|
+
*/
|
|
284
|
+
id: string;
|
|
285
|
+
/**
|
|
286
|
+
* URL of the link.
|
|
287
|
+
*/
|
|
288
|
+
href: string;
|
|
289
|
+
/**
|
|
290
|
+
* Label that is used as a text for the list item.
|
|
291
|
+
*/
|
|
292
|
+
label: string;
|
|
293
|
+
/**
|
|
294
|
+
* Optional icon displayed for the item.
|
|
295
|
+
*/
|
|
296
|
+
icon?: string;
|
|
297
297
|
};
|
|
298
298
|
/**
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
299
|
+
* Link list item with additional attributes that will be used when:
|
|
300
|
+
*
|
|
301
|
+
* * The item is selected and the preview of the item is displayed.
|
|
302
|
+
* * The user selects the item and the link is created.
|
|
303
|
+
* * The user navigates to the item using editing.
|
|
304
|
+
*
|
|
305
|
+
* It can be used to perform additional lookups in the database or to provide additional information about the link.
|
|
306
|
+
*/
|
|
307
307
|
export type LinksProviderDetailedItem = {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
308
|
+
/**
|
|
309
|
+
* URL of the link.
|
|
310
|
+
*/
|
|
311
|
+
href: string;
|
|
312
|
+
/**
|
|
313
|
+
* Optional icon displayed when the user opens toolbar with the item preview.
|
|
314
|
+
*/
|
|
315
|
+
icon?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Optional label shown in the link preview. If not passed then the `href` is used as the label.
|
|
318
|
+
*/
|
|
319
|
+
label?: string;
|
|
320
|
+
/**
|
|
321
|
+
* Optional tooltip shown in the link preview.
|
|
322
|
+
*/
|
|
323
|
+
tooltip?: string;
|
|
324
324
|
};
|
|
325
325
|
/**
|
|
326
|
-
|
|
327
|
-
|
|
326
|
+
* Interface for a provider that provides a list of links to be displayed in the link form view.
|
|
327
|
+
*/
|
|
328
328
|
export type LinksProvider = {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
329
|
+
/**
|
|
330
|
+
* Label that serves two purposes:
|
|
331
|
+
*
|
|
332
|
+
* * As a text for the button that opens this link list from within link form view.
|
|
333
|
+
* * As a text for the header when the list of links from this provider is displayed.
|
|
334
|
+
*/
|
|
335
|
+
label: string;
|
|
336
|
+
/**
|
|
337
|
+
* Message to be displayed when there are no items in the list.
|
|
338
|
+
* It's optional and if not provided, a default message will be displayed.
|
|
339
|
+
*/
|
|
340
|
+
emptyListPlaceholder?: string;
|
|
341
|
+
/**
|
|
342
|
+
* Weight used for ordering providers in the list. Higher weight means the provider will be displayed lower in the list.
|
|
343
|
+
*
|
|
344
|
+
* @default 0
|
|
345
|
+
*/
|
|
346
|
+
order?: number;
|
|
347
|
+
/**
|
|
348
|
+
* Callback for retrieving an static array of items which is being called every time the list is displayed.
|
|
349
|
+
* It's not required to provide all links at once, it's possible to pass only slice of links.
|
|
350
|
+
*/
|
|
351
|
+
getListItems(): Array<LinksProviderListItem>;
|
|
352
|
+
/**
|
|
353
|
+
* Optional callback for retrieving an item by its URL.
|
|
354
|
+
* If not provided the item from the list will be used.
|
|
355
|
+
*/
|
|
356
|
+
getItem?(href: string): LinksProviderDetailedItem | null;
|
|
357
|
+
/**
|
|
358
|
+
* Callback called when user clicked the link in the list.
|
|
359
|
+
*
|
|
360
|
+
* @param item Item that was clicked.
|
|
361
|
+
* @returns `true` if the link was handled by the provider, `false` otherwise. It'll prevent the default action if `true`.
|
|
362
|
+
*/
|
|
363
|
+
navigate?(item: LinksProviderDetailedItem): boolean;
|
|
364
364
|
};
|