@ckeditor/ckeditor5-link 36.0.1 → 37.0.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.
- package/build/link.js +1 -1
- package/package.json +30 -25
- package/src/augmentation.d.ts +30 -0
- package/src/augmentation.js +5 -0
- package/src/autolink.d.ts +59 -0
- package/src/autolink.js +192 -261
- package/src/index.d.ts +18 -0
- package/src/index.js +3 -2
- package/src/link.d.ts +24 -0
- package/src/link.js +12 -241
- package/src/linkcommand.d.ts +123 -0
- package/src/linkcommand.js +225 -273
- package/src/linkconfig.d.ts +251 -0
- package/src/linkconfig.js +5 -0
- package/src/linkediting.d.ts +104 -0
- package/src/linkediting.js +515 -664
- package/src/linkimage.d.ts +25 -0
- package/src/linkimage.js +12 -19
- package/src/linkimageediting.d.ts +38 -0
- package/src/linkimageediting.js +222 -275
- package/src/linkimageui.d.ts +38 -0
- package/src/linkimageui.js +75 -101
- package/src/linkui.d.ts +165 -0
- package/src/linkui.js +557 -729
- package/src/ui/linkactionsview.d.ts +101 -0
- package/src/ui/linkactionsview.js +134 -227
- package/src/ui/linkformview.d.ts +141 -0
- package/src/ui/linkformview.js +212 -342
- package/src/unlinkcommand.d.ts +31 -0
- package/src/unlinkcommand.js +51 -65
- package/src/utils/automaticdecorators.d.ts +45 -0
- package/src/utils/automaticdecorators.js +128 -149
- package/src/utils/manualdecorator.d.ts +72 -0
- package/src/utils/manualdecorator.js +36 -90
- package/src/utils.d.ts +80 -0
- package/src/utils.js +59 -125
package/src/autolink.js
CHANGED
|
@@ -2,284 +2,215 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module link/autolink
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
import { Plugin } from 'ckeditor5/src/core';
|
|
11
9
|
import { Delete, TextWatcher, getLastTextLine } from 'ckeditor5/src/typing';
|
|
12
|
-
|
|
13
10
|
import { addLinkProtocolIfApplicable, linkHasProtocol } from './utils';
|
|
14
|
-
|
|
15
11
|
const MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: "t.co " (length 5).
|
|
16
|
-
|
|
17
12
|
// This was a tweak from https://gist.github.com/dperini/729294.
|
|
18
13
|
const URL_REG_EXP = new RegExp(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
14
|
+
// Group 1: Line start or after a space.
|
|
15
|
+
'(^|\\s)' +
|
|
16
|
+
// Group 2: Detected URL (or e-mail).
|
|
17
|
+
'(' +
|
|
18
|
+
// Protocol identifier or short syntax "//"
|
|
19
|
+
// a. Full form http://user@foo.bar.baz:8080/foo/bar.html#baz?foo=bar
|
|
20
|
+
'(' +
|
|
21
|
+
'(?:(?:(?:https?|ftp):)?\\/\\/)' +
|
|
22
|
+
// BasicAuth using user:pass (optional)
|
|
23
|
+
'(?:\\S+(?::\\S*)?@)?' +
|
|
24
|
+
'(?:' +
|
|
25
|
+
// IP address dotted notation octets
|
|
26
|
+
// excludes loopback network 0.0.0.0
|
|
27
|
+
// excludes reserved space >= 224.0.0.0
|
|
28
|
+
// excludes network & broadcast addresses
|
|
29
|
+
// (first & last IP address of each class)
|
|
30
|
+
'(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])' +
|
|
31
|
+
'(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}' +
|
|
32
|
+
'(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))' +
|
|
33
|
+
'|' +
|
|
34
|
+
'(' +
|
|
35
|
+
// Do not allow `www.foo` - see https://github.com/ckeditor/ckeditor5/issues/8050.
|
|
36
|
+
'((?!www\\.)|(www\\.))' +
|
|
37
|
+
// Host & domain names.
|
|
38
|
+
'(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+' +
|
|
39
|
+
// TLD identifier name.
|
|
40
|
+
'(?:[a-z\\u00a1-\\uffff]{2,63})' +
|
|
41
|
+
')' +
|
|
42
|
+
')' +
|
|
43
|
+
// port number (optional)
|
|
44
|
+
'(?::\\d{2,5})?' +
|
|
45
|
+
// resource path (optional)
|
|
46
|
+
'(?:[/?#]\\S*)?' +
|
|
47
|
+
')' +
|
|
48
|
+
'|' +
|
|
49
|
+
// b. Short form (either www.example.com or example@example.com)
|
|
50
|
+
'(' +
|
|
51
|
+
'(www.|(\\S+@))' +
|
|
52
|
+
// Host & domain names.
|
|
53
|
+
'((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+' +
|
|
54
|
+
// TLD identifier name.
|
|
55
|
+
'(?:[a-z\\u00a1-\\uffff]{2,63})' +
|
|
56
|
+
')' +
|
|
57
|
+
')$', 'i');
|
|
64
58
|
const URL_GROUP_IN_MATCH = 2;
|
|
65
|
-
|
|
66
59
|
/**
|
|
67
60
|
* The autolink plugin.
|
|
68
|
-
*
|
|
69
|
-
* @extends module:core/plugin~Plugin
|
|
70
61
|
*/
|
|
71
62
|
export default class AutoLink extends Plugin {
|
|
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
|
-
const model = this.editor.model;
|
|
211
|
-
const { text, range } = getLastTextLine( rangeToCheck, model );
|
|
212
|
-
|
|
213
|
-
const url = getUrlAtTextEnd( text );
|
|
214
|
-
|
|
215
|
-
if ( url ) {
|
|
216
|
-
const linkRange = model.createRange(
|
|
217
|
-
range.end.getShiftedBy( -url.length ),
|
|
218
|
-
range.end
|
|
219
|
-
);
|
|
220
|
-
|
|
221
|
-
this._applyAutoLink( url, linkRange );
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Applies a link on a given range if the link should be applied.
|
|
227
|
-
*
|
|
228
|
-
* @param {String} url The URL to link.
|
|
229
|
-
* @param {module:engine/model/range~Range} range The text range to apply the link attribute to.
|
|
230
|
-
* @private
|
|
231
|
-
*/
|
|
232
|
-
_applyAutoLink( url, range ) {
|
|
233
|
-
const model = this.editor.model;
|
|
234
|
-
|
|
235
|
-
const defaultProtocol = this.editor.config.get( 'link.defaultProtocol' );
|
|
236
|
-
const fullUrl = addLinkProtocolIfApplicable( url, defaultProtocol );
|
|
237
|
-
|
|
238
|
-
if ( !this.isEnabled || !isLinkAllowedOnRange( range, model ) || !linkHasProtocol( fullUrl ) || linkIsAlreadySet( range ) ) {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
this._persistAutoLink( fullUrl, range );
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Enqueues autolink changes in the model.
|
|
247
|
-
*
|
|
248
|
-
* @param {String} url The URL to link.
|
|
249
|
-
* @param {module:engine/model/range~Range} range The text range to apply the link attribute to.
|
|
250
|
-
* @protected
|
|
251
|
-
*/
|
|
252
|
-
_persistAutoLink( url, range ) {
|
|
253
|
-
const model = this.editor.model;
|
|
254
|
-
const deletePlugin = this.editor.plugins.get( 'Delete' );
|
|
255
|
-
|
|
256
|
-
// Enqueue change to make undo step.
|
|
257
|
-
model.enqueueChange( writer => {
|
|
258
|
-
writer.setAttribute( 'linkHref', url, range );
|
|
259
|
-
|
|
260
|
-
model.enqueueChange( () => {
|
|
261
|
-
deletePlugin.requestUndoOnBackspace();
|
|
262
|
-
} );
|
|
263
|
-
} );
|
|
264
|
-
}
|
|
63
|
+
/**
|
|
64
|
+
* @inheritDoc
|
|
65
|
+
*/
|
|
66
|
+
static get requires() {
|
|
67
|
+
return [Delete];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @inheritDoc
|
|
71
|
+
*/
|
|
72
|
+
static get pluginName() {
|
|
73
|
+
return 'AutoLink';
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* @inheritDoc
|
|
77
|
+
*/
|
|
78
|
+
init() {
|
|
79
|
+
const editor = this.editor;
|
|
80
|
+
const selection = editor.model.document.selection;
|
|
81
|
+
selection.on('change:range', () => {
|
|
82
|
+
// Disable plugin when selection is inside a code block.
|
|
83
|
+
this.isEnabled = !selection.anchor.parent.is('element', 'codeBlock');
|
|
84
|
+
});
|
|
85
|
+
this._enableTypingHandling();
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @inheritDoc
|
|
89
|
+
*/
|
|
90
|
+
afterInit() {
|
|
91
|
+
this._enableEnterHandling();
|
|
92
|
+
this._enableShiftEnterHandling();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Enables autolinking on typing.
|
|
96
|
+
*/
|
|
97
|
+
_enableTypingHandling() {
|
|
98
|
+
const editor = this.editor;
|
|
99
|
+
const watcher = new TextWatcher(editor.model, text => {
|
|
100
|
+
// 1. Detect <kbd>Space</kbd> after a text with a potential link.
|
|
101
|
+
if (!isSingleSpaceAtTheEnd(text)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
// 2. Check text before last typed <kbd>Space</kbd>.
|
|
105
|
+
const url = getUrlAtTextEnd(text.substr(0, text.length - 1));
|
|
106
|
+
if (url) {
|
|
107
|
+
return { url };
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
watcher.on('matched:data', (evt, data) => {
|
|
111
|
+
const { batch, range, url } = data;
|
|
112
|
+
if (!batch.isTyping) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const linkEnd = range.end.getShiftedBy(-1); // Executed after a space character.
|
|
116
|
+
const linkStart = linkEnd.getShiftedBy(-url.length);
|
|
117
|
+
const linkRange = editor.model.createRange(linkStart, linkEnd);
|
|
118
|
+
this._applyAutoLink(url, linkRange);
|
|
119
|
+
});
|
|
120
|
+
watcher.bind('isEnabled').to(this);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Enables autolinking on the <kbd>Enter</kbd> key.
|
|
124
|
+
*/
|
|
125
|
+
_enableEnterHandling() {
|
|
126
|
+
const editor = this.editor;
|
|
127
|
+
const model = editor.model;
|
|
128
|
+
const enterCommand = editor.commands.get('enter');
|
|
129
|
+
if (!enterCommand) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
enterCommand.on('execute', () => {
|
|
133
|
+
const position = model.document.selection.getFirstPosition();
|
|
134
|
+
if (!position.parent.previousSibling) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const rangeToCheck = model.createRangeIn(position.parent.previousSibling);
|
|
138
|
+
this._checkAndApplyAutoLinkOnRange(rangeToCheck);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Enables autolinking on the <kbd>Shift</kbd>+<kbd>Enter</kbd> keyboard shortcut.
|
|
143
|
+
*/
|
|
144
|
+
_enableShiftEnterHandling() {
|
|
145
|
+
const editor = this.editor;
|
|
146
|
+
const model = editor.model;
|
|
147
|
+
const shiftEnterCommand = editor.commands.get('shiftEnter');
|
|
148
|
+
if (!shiftEnterCommand) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
shiftEnterCommand.on('execute', () => {
|
|
152
|
+
const position = model.document.selection.getFirstPosition();
|
|
153
|
+
const rangeToCheck = model.createRange(model.createPositionAt(position.parent, 0), position.getShiftedBy(-1));
|
|
154
|
+
this._checkAndApplyAutoLinkOnRange(rangeToCheck);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Checks if the passed range contains a linkable text.
|
|
159
|
+
*/
|
|
160
|
+
_checkAndApplyAutoLinkOnRange(rangeToCheck) {
|
|
161
|
+
const model = this.editor.model;
|
|
162
|
+
const { text, range } = getLastTextLine(rangeToCheck, model);
|
|
163
|
+
const url = getUrlAtTextEnd(text);
|
|
164
|
+
if (url) {
|
|
165
|
+
const linkRange = model.createRange(range.end.getShiftedBy(-url.length), range.end);
|
|
166
|
+
this._applyAutoLink(url, linkRange);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Applies a link on a given range if the link should be applied.
|
|
171
|
+
*
|
|
172
|
+
* @param url The URL to link.
|
|
173
|
+
* @param range The text range to apply the link attribute to.
|
|
174
|
+
*/
|
|
175
|
+
_applyAutoLink(url, range) {
|
|
176
|
+
const model = this.editor.model;
|
|
177
|
+
const defaultProtocol = this.editor.config.get('link.defaultProtocol');
|
|
178
|
+
const fullUrl = addLinkProtocolIfApplicable(url, defaultProtocol);
|
|
179
|
+
if (!this.isEnabled || !isLinkAllowedOnRange(range, model) || !linkHasProtocol(fullUrl) || linkIsAlreadySet(range)) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
this._persistAutoLink(fullUrl, range);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Enqueues autolink changes in the model.
|
|
186
|
+
*
|
|
187
|
+
* @param url The URL to link.
|
|
188
|
+
* @param range The text range to apply the link attribute to.
|
|
189
|
+
*/
|
|
190
|
+
_persistAutoLink(url, range) {
|
|
191
|
+
const model = this.editor.model;
|
|
192
|
+
const deletePlugin = this.editor.plugins.get('Delete');
|
|
193
|
+
// Enqueue change to make undo step.
|
|
194
|
+
model.enqueueChange(writer => {
|
|
195
|
+
writer.setAttribute('linkHref', url, range);
|
|
196
|
+
model.enqueueChange(() => {
|
|
197
|
+
deletePlugin.requestUndoOnBackspace();
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
}
|
|
265
201
|
}
|
|
266
|
-
|
|
267
202
|
// Check if text should be evaluated by the plugin in order to reduce number of RegExp checks on whole text.
|
|
268
|
-
function isSingleSpaceAtTheEnd(
|
|
269
|
-
|
|
203
|
+
function isSingleSpaceAtTheEnd(text) {
|
|
204
|
+
return text.length > MIN_LINK_LENGTH_WITH_SPACE_AT_END && text[text.length - 1] === ' ' && text[text.length - 2] !== ' ';
|
|
270
205
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
return match ? match[ URL_GROUP_IN_MATCH ] : null;
|
|
206
|
+
function getUrlAtTextEnd(text) {
|
|
207
|
+
const match = URL_REG_EXP.exec(text);
|
|
208
|
+
return match ? match[URL_GROUP_IN_MATCH] : null;
|
|
276
209
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
return model.schema.checkAttributeInSelection( model.createSelection( range ), 'linkHref' );
|
|
210
|
+
function isLinkAllowedOnRange(range, model) {
|
|
211
|
+
return model.schema.checkAttributeInSelection(model.createSelection(range), 'linkHref');
|
|
280
212
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
return item && item.hasAttribute( 'linkHref' );
|
|
213
|
+
function linkIsAlreadySet(range) {
|
|
214
|
+
const item = range.start.nodeAfter;
|
|
215
|
+
return !!item && item.hasAttribute('linkHref');
|
|
285
216
|
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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 link
|
|
7
|
+
*/
|
|
8
|
+
export { default as Link } from './link';
|
|
9
|
+
export { default as LinkEditing } from './linkediting';
|
|
10
|
+
export { default as LinkUI } from './linkui';
|
|
11
|
+
export { default as LinkImage } from './linkimage';
|
|
12
|
+
export { default as LinkImageEditing } from './linkimageediting';
|
|
13
|
+
export { default as LinkImageUI } from './linkimageui';
|
|
14
|
+
export { default as AutoLink } from './autolink';
|
|
15
|
+
export { LinkConfig } from './linkconfig';
|
|
16
|
+
export { default as LinkCommand } from './linkcommand';
|
|
17
|
+
export { default as UnlinkCommand } from './unlinkcommand';
|
|
18
|
+
import './augmentation';
|
package/src/index.js
CHANGED
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module link
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
export { default as Link } from './link';
|
|
11
9
|
export { default as LinkEditing } from './linkediting';
|
|
12
10
|
export { default as LinkUI } from './linkui';
|
|
@@ -14,3 +12,6 @@ export { default as LinkImage } from './linkimage';
|
|
|
14
12
|
export { default as LinkImageEditing } from './linkimageediting';
|
|
15
13
|
export { default as LinkImageUI } from './linkimageui';
|
|
16
14
|
export { default as AutoLink } from './autolink';
|
|
15
|
+
export { default as LinkCommand } from './linkcommand';
|
|
16
|
+
export { default as UnlinkCommand } from './unlinkcommand';
|
|
17
|
+
import './augmentation';
|
package/src/link.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
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 link/link
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependencies } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The link plugin.
|
|
11
|
+
*
|
|
12
|
+
* This is a "glue" plugin that loads the {@link module:link/linkediting~LinkEditing link editing feature}
|
|
13
|
+
* and {@link module:link/linkui~LinkUI link UI feature}.
|
|
14
|
+
*/
|
|
15
|
+
export default class Link extends Plugin {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get requires(): PluginDependencies;
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get pluginName(): 'Link';
|
|
24
|
+
}
|