@ckeditor/ckeditor5-media-embed 0.0.0-nightly-20240603.0 → 0.0.0-nightly-20240604.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.
Potentially problematic release.
This version of @ckeditor/ckeditor5-media-embed might be problematic. Click here for more details.
- package/build/media-embed.js +1 -1
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/types/mediaembedui.d.ts +1 -0
- package/package.json +3 -3
- package/src/mediaembedui.d.ts +1 -0
- package/src/mediaembedui.js +11 -7
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-media-embed",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20240604.1",
|
4
4
|
"description": "Media embed feature for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -13,8 +13,8 @@
|
|
13
13
|
"type": "module",
|
14
14
|
"main": "src/index.js",
|
15
15
|
"dependencies": {
|
16
|
-
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-
|
17
|
-
"ckeditor5": "0.0.0-nightly-
|
16
|
+
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-20240604.1",
|
17
|
+
"ckeditor5": "0.0.0-nightly-20240604.1"
|
18
18
|
},
|
19
19
|
"author": "CKSource (http://cksource.com/)",
|
20
20
|
"license": "GPL-2.0-or-later",
|
package/src/mediaembedui.d.ts
CHANGED
package/src/mediaembedui.js
CHANGED
@@ -73,6 +73,7 @@ export default class MediaEmbedUI extends Plugin {
|
|
73
73
|
if (!this._formView) {
|
74
74
|
const registry = editor.plugins.get(MediaEmbedEditing).registry;
|
75
75
|
this._formView = new (CssTransitionDisablerMixin(MediaFormView))(getFormValidators(editor.t, registry), editor.locale);
|
76
|
+
this._formView.on('submit', () => this._handleSubmitForm());
|
76
77
|
}
|
77
78
|
dialog.show({
|
78
79
|
id: 'mediaEmbed',
|
@@ -94,17 +95,20 @@ export default class MediaEmbedUI extends Plugin {
|
|
94
95
|
label: t('Accept'),
|
95
96
|
class: 'ck-button-action',
|
96
97
|
withText: true,
|
97
|
-
onExecute: () =>
|
98
|
-
if (this._formView.isValid()) {
|
99
|
-
editor.execute('mediaEmbed', this._formView.url);
|
100
|
-
dialog.hide();
|
101
|
-
editor.editing.view.focus();
|
102
|
-
}
|
103
|
-
}
|
98
|
+
onExecute: () => this._handleSubmitForm()
|
104
99
|
}
|
105
100
|
]
|
106
101
|
});
|
107
102
|
}
|
103
|
+
_handleSubmitForm() {
|
104
|
+
const editor = this.editor;
|
105
|
+
const dialog = editor.plugins.get('Dialog');
|
106
|
+
if (this._formView.isValid()) {
|
107
|
+
editor.execute('mediaEmbed', this._formView.url);
|
108
|
+
dialog.hide();
|
109
|
+
editor.editing.view.focus();
|
110
|
+
}
|
111
|
+
}
|
108
112
|
}
|
109
113
|
function getFormValidators(t, registry) {
|
110
114
|
return [
|