@ckeditor/ckeditor5-link 45.0.0-alpha.5 → 45.0.0-alpha.7
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/dist/index.js +28 -4
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/linkimageediting.js +14 -0
- package/src/linkui.js +14 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-link",
|
|
3
|
-
"version": "45.0.0-alpha.
|
|
3
|
+
"version": "45.0.0-alpha.7",
|
|
4
4
|
"description": "Link feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "src/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.
|
|
17
|
-
"@ckeditor/ckeditor5-core": "45.0.0-alpha.
|
|
18
|
-
"@ckeditor/ckeditor5-engine": "45.0.0-alpha.
|
|
19
|
-
"@ckeditor/ckeditor5-icons": "45.0.0-alpha.
|
|
20
|
-
"@ckeditor/ckeditor5-image": "45.0.0-alpha.
|
|
21
|
-
"@ckeditor/ckeditor5-typing": "45.0.0-alpha.
|
|
22
|
-
"@ckeditor/ckeditor5-ui": "45.0.0-alpha.
|
|
23
|
-
"@ckeditor/ckeditor5-utils": "45.0.0-alpha.
|
|
24
|
-
"@ckeditor/ckeditor5-widget": "45.0.0-alpha.
|
|
25
|
-
"ckeditor5": "45.0.0-alpha.
|
|
16
|
+
"@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.7",
|
|
17
|
+
"@ckeditor/ckeditor5-core": "45.0.0-alpha.7",
|
|
18
|
+
"@ckeditor/ckeditor5-engine": "45.0.0-alpha.7",
|
|
19
|
+
"@ckeditor/ckeditor5-icons": "45.0.0-alpha.7",
|
|
20
|
+
"@ckeditor/ckeditor5-image": "45.0.0-alpha.7",
|
|
21
|
+
"@ckeditor/ckeditor5-typing": "45.0.0-alpha.7",
|
|
22
|
+
"@ckeditor/ckeditor5-ui": "45.0.0-alpha.7",
|
|
23
|
+
"@ckeditor/ckeditor5-utils": "45.0.0-alpha.7",
|
|
24
|
+
"@ckeditor/ckeditor5-widget": "45.0.0-alpha.7",
|
|
25
|
+
"ckeditor5": "45.0.0-alpha.7",
|
|
26
26
|
"es-toolkit": "1.32.0"
|
|
27
27
|
},
|
|
28
28
|
"author": "CKSource (http://cksource.com/)",
|
package/src/linkimageediting.js
CHANGED
|
@@ -198,6 +198,20 @@ function downcastImageLinkManualDecorator(decorator) {
|
|
|
198
198
|
if (!linkInImage) {
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
+
// Handle deactivated manual decorator.
|
|
202
|
+
if (decorator.value === undefined) {
|
|
203
|
+
for (const key in decorator.attributes) {
|
|
204
|
+
conversionApi.writer.removeAttribute(key, linkInImage);
|
|
205
|
+
}
|
|
206
|
+
if (decorator.classes) {
|
|
207
|
+
conversionApi.writer.removeClass(decorator.classes, linkInImage);
|
|
208
|
+
}
|
|
209
|
+
for (const key in decorator.styles) {
|
|
210
|
+
conversionApi.writer.removeStyle(key, linkInImage);
|
|
211
|
+
}
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
// Handle activated manual decorator.
|
|
201
215
|
for (const [key, val] of toMap(decorator.attributes)) {
|
|
202
216
|
conversionApi.writer.setAttribute(key, val, linkInImage);
|
|
203
217
|
}
|
package/src/linkui.js
CHANGED
|
@@ -498,6 +498,7 @@ export default class LinkUI extends Plugin {
|
|
|
498
498
|
view.bind('isOn').to(command, 'value', value => !!value);
|
|
499
499
|
// Show the panel on button click.
|
|
500
500
|
this.listenTo(view, 'execute', () => {
|
|
501
|
+
editor.editing.view.scrollToTheSelection();
|
|
501
502
|
this._showUI(true);
|
|
502
503
|
// Open the form view on-top of the toolbar view if it's already visible.
|
|
503
504
|
// It should be visible every time the link is selected.
|
|
@@ -528,6 +529,7 @@ export default class LinkUI extends Plugin {
|
|
|
528
529
|
// Prevent focusing the search bar in FF, Chrome and Edge. See https://github.com/ckeditor/ckeditor5/issues/4811.
|
|
529
530
|
cancel();
|
|
530
531
|
if (editor.commands.get('link').isEnabled) {
|
|
532
|
+
editor.editing.view.scrollToTheSelection();
|
|
531
533
|
this._showUI(true);
|
|
532
534
|
}
|
|
533
535
|
});
|
|
@@ -561,7 +563,13 @@ export default class LinkUI extends Plugin {
|
|
|
561
563
|
emitter: this.formView,
|
|
562
564
|
activator: () => this._isUIInPanel,
|
|
563
565
|
contextElements: () => [this._balloon.view.element],
|
|
564
|
-
callback: () =>
|
|
566
|
+
callback: () => {
|
|
567
|
+
// Focusing on the editable during a click outside the balloon panel might
|
|
568
|
+
// cause the selection to move to the beginning of the editable, so we avoid
|
|
569
|
+
// focusing on it during this action.
|
|
570
|
+
// See: https://github.com/ckeditor/ckeditor5/issues/18253
|
|
571
|
+
this._hideUI(false);
|
|
572
|
+
}
|
|
565
573
|
});
|
|
566
574
|
}
|
|
567
575
|
/**
|
|
@@ -690,7 +698,7 @@ export default class LinkUI extends Plugin {
|
|
|
690
698
|
/**
|
|
691
699
|
* Removes the {@link #formView} from the {@link #_balloon}.
|
|
692
700
|
*/
|
|
693
|
-
_removeFormView() {
|
|
701
|
+
_removeFormView(updateFocus = true) {
|
|
694
702
|
if (this._isFormInPanel) {
|
|
695
703
|
// Blur the input element before removing it from DOM to prevent issues in some browsers.
|
|
696
704
|
// See https://github.com/ckeditor/ckeditor5/issues/1501.
|
|
@@ -701,7 +709,9 @@ export default class LinkUI extends Plugin {
|
|
|
701
709
|
this._balloon.remove(this.formView);
|
|
702
710
|
// Because the form has an input which has focus, the focus must be brought back
|
|
703
711
|
// to the editor. Otherwise, it would be lost.
|
|
704
|
-
|
|
712
|
+
if (updateFocus) {
|
|
713
|
+
this.editor.editing.view.focus();
|
|
714
|
+
}
|
|
705
715
|
this._hideFakeVisualSelection();
|
|
706
716
|
}
|
|
707
717
|
}
|
|
@@ -766,7 +776,7 @@ export default class LinkUI extends Plugin {
|
|
|
766
776
|
// If the properties form view is visible, remove it because it can be on top of the stack.
|
|
767
777
|
this._removePropertiesView();
|
|
768
778
|
// Then remove the form view because it's beneath the properties form.
|
|
769
|
-
this._removeFormView();
|
|
779
|
+
this._removeFormView(updateFocus);
|
|
770
780
|
// Finally, remove the link toolbar view because it's last in the stack.
|
|
771
781
|
if (this._isToolbarInPanel) {
|
|
772
782
|
this._balloon.remove(this.toolbarView);
|