@ckeditor/ckeditor5-media-embed 44.3.0 → 45.0.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/build/media-embed.js +2 -2
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/ast.js +1 -1
- package/build/translations/az.js +1 -1
- package/build/translations/be.js +1 -0
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/en-gb.js +1 -1
- package/build/translations/eo.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/eu.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/gu.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/hy.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/kk.js +1 -1
- package/build/translations/km.js +1 -1
- package/build/translations/kn.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/ku.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nb.js +1 -1
- package/build/translations/ne.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/oc.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/si.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sl.js +1 -1
- package/build/translations/sq.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/ti.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/uz.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/ckeditor5-metadata.json +1 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.d.ts +8 -0
- package/dist/translations/be.js +5 -0
- package/dist/translations/be.umd.js +11 -0
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/lang/contexts.json +1 -0
- package/lang/translations/af.po +4 -0
- package/lang/translations/ar.po +4 -0
- package/lang/translations/ast.po +4 -0
- package/lang/translations/az.po +4 -0
- package/lang/translations/be.po +56 -0
- package/lang/translations/bg.po +4 -0
- package/lang/translations/bn.po +4 -0
- package/lang/translations/bs.po +4 -0
- package/lang/translations/ca.po +4 -0
- package/lang/translations/cs.po +4 -0
- package/lang/translations/da.po +4 -0
- package/lang/translations/de-ch.po +4 -0
- package/lang/translations/de.po +4 -0
- package/lang/translations/el.po +4 -0
- package/lang/translations/en-au.po +4 -0
- package/lang/translations/en-gb.po +4 -0
- package/lang/translations/en.po +4 -0
- package/lang/translations/eo.po +4 -0
- package/lang/translations/es-co.po +4 -0
- package/lang/translations/es.po +4 -0
- package/lang/translations/et.po +4 -0
- package/lang/translations/eu.po +4 -0
- package/lang/translations/fa.po +4 -0
- package/lang/translations/fi.po +4 -0
- package/lang/translations/fr.po +4 -0
- package/lang/translations/gl.po +4 -0
- package/lang/translations/gu.po +4 -0
- package/lang/translations/he.po +4 -0
- package/lang/translations/hi.po +4 -0
- package/lang/translations/hr.po +4 -0
- package/lang/translations/hu.po +4 -0
- package/lang/translations/hy.po +4 -0
- package/lang/translations/id.po +4 -0
- package/lang/translations/it.po +4 -0
- package/lang/translations/ja.po +4 -0
- package/lang/translations/jv.po +4 -0
- package/lang/translations/kk.po +4 -0
- package/lang/translations/km.po +4 -0
- package/lang/translations/kn.po +4 -0
- package/lang/translations/ko.po +4 -0
- package/lang/translations/ku.po +4 -0
- package/lang/translations/lt.po +4 -0
- package/lang/translations/lv.po +4 -0
- package/lang/translations/ms.po +4 -0
- package/lang/translations/nb.po +4 -0
- package/lang/translations/ne.po +4 -0
- package/lang/translations/nl.po +4 -0
- package/lang/translations/no.po +4 -0
- package/lang/translations/oc.po +4 -0
- package/lang/translations/pl.po +4 -0
- package/lang/translations/pt-br.po +4 -0
- package/lang/translations/pt.po +4 -0
- package/lang/translations/ro.po +4 -0
- package/lang/translations/ru.po +4 -0
- package/lang/translations/si.po +4 -0
- package/lang/translations/sk.po +4 -0
- package/lang/translations/sl.po +4 -0
- package/lang/translations/sq.po +4 -0
- package/lang/translations/sr-latn.po +4 -0
- package/lang/translations/sr.po +4 -0
- package/lang/translations/sv.po +4 -0
- package/lang/translations/th.po +4 -0
- package/lang/translations/ti.po +4 -0
- package/lang/translations/tk.po +4 -0
- package/lang/translations/tr.po +4 -0
- package/lang/translations/tt.po +4 -0
- package/lang/translations/ug.po +4 -0
- package/lang/translations/uk.po +4 -0
- package/lang/translations/ur.po +4 -0
- package/lang/translations/uz.po +4 -0
- package/lang/translations/vi.po +4 -0
- package/lang/translations/zh-cn.po +4 -0
- package/lang/translations/zh.po +4 -0
- package/package.json +11 -10
- package/src/automediaembed.js +10 -0
- package/src/mediaembedediting.js +4 -0
- package/src/mediaembedui.js +6 -4
- package/src/mediaregistry.d.ts +1 -4
- package/src/mediaregistry.js +32 -2
- package/src/ui/mediaformview.js +25 -0
- package/theme/icons/media/twitter.svg +0 -20
- package/theme/icons/media-placeholder.svg +0 -1
- package/theme/icons/media.svg +0 -1
package/lang/translations/tk.po
CHANGED
@@ -50,3 +50,7 @@ msgstr "Mediýa gurallar paneli"
|
|
50
50
|
msgctxt "A tooltip displayed when the user hovers a non-previewable media URL in the editor content."
|
51
51
|
msgid "Open media in new tab"
|
52
52
|
msgstr ""
|
53
|
+
|
54
|
+
msgctxt "The label for the Media Embed balloon."
|
55
|
+
msgid "Media embed"
|
56
|
+
msgstr ""
|
package/lang/translations/tr.po
CHANGED
@@ -50,3 +50,7 @@ msgstr "Medya araç çubuğu"
|
|
50
50
|
msgctxt "A tooltip displayed when the user hovers a non-previewable media URL in the editor content."
|
51
51
|
msgid "Open media in new tab"
|
52
52
|
msgstr "Medyayı yeni sekmede aç"
|
53
|
+
|
54
|
+
msgctxt "The label for the Media Embed balloon."
|
55
|
+
msgid "Media embed"
|
56
|
+
msgstr ""
|
package/lang/translations/tt.po
CHANGED
package/lang/translations/ug.po
CHANGED
package/lang/translations/uk.po
CHANGED
@@ -50,3 +50,7 @@ msgstr "Панель інструментів медіа"
|
|
50
50
|
msgctxt "A tooltip displayed when the user hovers a non-previewable media URL in the editor content."
|
51
51
|
msgid "Open media in new tab"
|
52
52
|
msgstr "Відкрити медіа у новій вкладці"
|
53
|
+
|
54
|
+
msgctxt "The label for the Media Embed balloon."
|
55
|
+
msgid "Media embed"
|
56
|
+
msgstr ""
|
package/lang/translations/ur.po
CHANGED
@@ -50,3 +50,7 @@ msgstr "آلہ جات برائے میڈیا"
|
|
50
50
|
msgctxt "A tooltip displayed when the user hovers a non-previewable media URL in the editor content."
|
51
51
|
msgid "Open media in new tab"
|
52
52
|
msgstr ""
|
53
|
+
|
54
|
+
msgctxt "The label for the Media Embed balloon."
|
55
|
+
msgid "Media embed"
|
56
|
+
msgstr ""
|
package/lang/translations/uz.po
CHANGED
@@ -50,3 +50,7 @@ msgstr "Media asboblar paneli"
|
|
50
50
|
msgctxt "A tooltip displayed when the user hovers a non-previewable media URL in the editor content."
|
51
51
|
msgid "Open media in new tab"
|
52
52
|
msgstr ""
|
53
|
+
|
54
|
+
msgctxt "The label for the Media Embed balloon."
|
55
|
+
msgid "Media embed"
|
56
|
+
msgstr ""
|
package/lang/translations/vi.po
CHANGED
@@ -50,3 +50,7 @@ msgstr "Thanh công cụ đa phương tiện"
|
|
50
50
|
msgctxt "A tooltip displayed when the user hovers a non-previewable media URL in the editor content."
|
51
51
|
msgid "Open media in new tab"
|
52
52
|
msgstr "Mở nội dung nghe nhìn trong tab mới"
|
53
|
+
|
54
|
+
msgctxt "The label for the Media Embed balloon."
|
55
|
+
msgid "Media embed"
|
56
|
+
msgstr ""
|
@@ -50,3 +50,7 @@ msgstr "媒体工具栏"
|
|
50
50
|
msgctxt "A tooltip displayed when the user hovers a non-previewable media URL in the editor content."
|
51
51
|
msgid "Open media in new tab"
|
52
52
|
msgstr "在新标签页打开媒体"
|
53
|
+
|
54
|
+
msgctxt "The label for the Media Embed balloon."
|
55
|
+
msgid "Media embed"
|
56
|
+
msgstr ""
|
package/lang/translations/zh.po
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-media-embed",
|
3
|
-
"version": "
|
3
|
+
"version": "45.0.0-alpha.0",
|
4
4
|
"description": "Media embed feature for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -13,15 +13,16 @@
|
|
13
13
|
"type": "module",
|
14
14
|
"main": "src/index.js",
|
15
15
|
"dependencies": {
|
16
|
-
"@ckeditor/ckeditor5-clipboard": "
|
17
|
-
"@ckeditor/ckeditor5-core": "
|
18
|
-
"@ckeditor/ckeditor5-engine": "
|
19
|
-
"@ckeditor/ckeditor5-
|
20
|
-
"@ckeditor/ckeditor5-
|
21
|
-
"@ckeditor/ckeditor5-
|
22
|
-
"@ckeditor/ckeditor5-
|
23
|
-
"@ckeditor/ckeditor5-
|
24
|
-
"ckeditor5": "
|
16
|
+
"@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.0",
|
17
|
+
"@ckeditor/ckeditor5-core": "45.0.0-alpha.0",
|
18
|
+
"@ckeditor/ckeditor5-engine": "45.0.0-alpha.0",
|
19
|
+
"@ckeditor/ckeditor5-icons": "45.0.0-alpha.0",
|
20
|
+
"@ckeditor/ckeditor5-typing": "45.0.0-alpha.0",
|
21
|
+
"@ckeditor/ckeditor5-ui": "45.0.0-alpha.0",
|
22
|
+
"@ckeditor/ckeditor5-undo": "45.0.0-alpha.0",
|
23
|
+
"@ckeditor/ckeditor5-utils": "45.0.0-alpha.0",
|
24
|
+
"@ckeditor/ckeditor5-widget": "45.0.0-alpha.0",
|
25
|
+
"ckeditor5": "45.0.0-alpha.0"
|
25
26
|
},
|
26
27
|
"author": "CKSource (http://cksource.com/)",
|
27
28
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/automediaembed.js
CHANGED
@@ -37,6 +37,16 @@ export default class AutoMediaEmbed extends Plugin {
|
|
37
37
|
static get isOfficialPlugin() {
|
38
38
|
return true;
|
39
39
|
}
|
40
|
+
/**
|
41
|
+
* The paste–to–embed `setTimeout` ID. Stored as a property to allow
|
42
|
+
* cleaning of the timeout.
|
43
|
+
*/
|
44
|
+
_timeoutId;
|
45
|
+
/**
|
46
|
+
* The position where the `<media>` element will be inserted after the timeout,
|
47
|
+
* determined each time the new content is pasted into the document.
|
48
|
+
*/
|
49
|
+
_positionToInsert;
|
40
50
|
/**
|
41
51
|
* @inheritDoc
|
42
52
|
*/
|
package/src/mediaembedediting.js
CHANGED
package/src/mediaembedui.js
CHANGED
@@ -6,10 +6,10 @@
|
|
6
6
|
* @module media-embed/mediaembedui
|
7
7
|
*/
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
9
|
+
import { IconMedia } from 'ckeditor5/src/icons.js';
|
9
10
|
import { ButtonView, CssTransitionDisablerMixin, MenuBarMenuListItemButtonView, Dialog } from 'ckeditor5/src/ui.js';
|
10
11
|
import MediaFormView from './ui/mediaformview.js';
|
11
12
|
import MediaEmbedEditing from './mediaembedediting.js';
|
12
|
-
import mediaIcon from '../theme/icons/media.svg';
|
13
13
|
/**
|
14
14
|
* The media embed UI plugin.
|
15
15
|
*/
|
@@ -32,6 +32,7 @@ export default class MediaEmbedUI extends Plugin {
|
|
32
32
|
static get isOfficialPlugin() {
|
33
33
|
return true;
|
34
34
|
}
|
35
|
+
_formView;
|
35
36
|
/**
|
36
37
|
* @inheritDoc
|
37
38
|
*/
|
@@ -59,7 +60,7 @@ export default class MediaEmbedUI extends Plugin {
|
|
59
60
|
const buttonView = new ButtonClass(editor.locale);
|
60
61
|
const command = editor.commands.get('mediaEmbed');
|
61
62
|
const dialogPlugin = this.editor.plugins.get('Dialog');
|
62
|
-
buttonView.icon =
|
63
|
+
buttonView.icon = IconMedia;
|
63
64
|
buttonView.bind('isEnabled').to(command, 'isEnabled');
|
64
65
|
buttonView.on('execute', () => {
|
65
66
|
if (dialogPlugin.id === 'mediaEmbed') {
|
@@ -76,6 +77,7 @@ export default class MediaEmbedUI extends Plugin {
|
|
76
77
|
const dialog = editor.plugins.get('Dialog');
|
77
78
|
const command = editor.commands.get('mediaEmbed');
|
78
79
|
const t = editor.locale.t;
|
80
|
+
const isMediaSelected = command.value !== undefined;
|
79
81
|
if (!this._formView) {
|
80
82
|
const registry = editor.plugins.get(MediaEmbedEditing).registry;
|
81
83
|
this._formView = new (CssTransitionDisablerMixin(MediaFormView))(getFormValidators(editor.t, registry), editor.locale);
|
@@ -83,7 +85,7 @@ export default class MediaEmbedUI extends Plugin {
|
|
83
85
|
}
|
84
86
|
dialog.show({
|
85
87
|
id: 'mediaEmbed',
|
86
|
-
title: t('
|
88
|
+
title: t('Media embed'),
|
87
89
|
content: this._formView,
|
88
90
|
isModal: true,
|
89
91
|
onShow: () => {
|
@@ -98,7 +100,7 @@ export default class MediaEmbedUI extends Plugin {
|
|
98
100
|
onExecute: () => dialog.hide()
|
99
101
|
},
|
100
102
|
{
|
101
|
-
label: t('
|
103
|
+
label: isMediaSelected ? t('Save') : t('Insert'),
|
102
104
|
class: 'ck-button-action',
|
103
105
|
withText: true,
|
104
106
|
onExecute: () => this._handleSubmitForm()
|
package/src/mediaregistry.d.ts
CHANGED
@@ -2,11 +2,8 @@
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
|
-
/**
|
6
|
-
* @module media-embed/mediaregistry
|
7
|
-
*/
|
8
|
-
import type { DowncastWriter, ViewElement } from 'ckeditor5/src/engine.js';
|
9
5
|
import { type Locale } from 'ckeditor5/src/utils.js';
|
6
|
+
import type { DowncastWriter, ViewElement } from 'ckeditor5/src/engine.js';
|
10
7
|
import type { MediaEmbedConfig, MediaEmbedProvider } from './mediaembedconfig.js';
|
11
8
|
import type { MediaOptions } from './utils.js';
|
12
9
|
/**
|
package/src/mediaregistry.js
CHANGED
@@ -2,9 +2,12 @@
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
4
4
|
*/
|
5
|
+
/**
|
6
|
+
* @module media-embed/mediaregistry
|
7
|
+
*/
|
5
8
|
import { IconView, Template } from 'ckeditor5/src/ui.js';
|
9
|
+
import { IconMediaPlaceholder } from 'ckeditor5/src/icons.js';
|
6
10
|
import { logWarning, toArray } from 'ckeditor5/src/utils.js';
|
7
|
-
import mediaPlaceholderIcon from '../theme/icons/media-placeholder.svg';
|
8
11
|
const mediaPlaceholderIconViewBox = '0 0 64 42';
|
9
12
|
/**
|
10
13
|
* A bridge between the raw media content provider definitions and the editor view content.
|
@@ -14,6 +17,15 @@ const mediaPlaceholderIconViewBox = '0 0 64 42';
|
|
14
17
|
* Mostly used by the {@link module:media-embed/mediaembedediting~MediaEmbedEditing} plugin.
|
15
18
|
*/
|
16
19
|
export default class MediaRegistry {
|
20
|
+
/**
|
21
|
+
* The {@link module:utils/locale~Locale} instance.
|
22
|
+
*/
|
23
|
+
locale;
|
24
|
+
/**
|
25
|
+
* The media provider definitions available for the registry. Usually corresponding with the
|
26
|
+
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig media configuration}.
|
27
|
+
*/
|
28
|
+
providerDefinitions;
|
17
29
|
/**
|
18
30
|
* Creates an instance of the {@link module:media-embed/mediaregistry~MediaRegistry} class.
|
19
31
|
*
|
@@ -120,6 +132,24 @@ export default class MediaRegistry {
|
|
120
132
|
* It can be rendered to the {@link module:engine/view/element~Element view element} and used in the editing or data pipeline.
|
121
133
|
*/
|
122
134
|
class Media {
|
135
|
+
/**
|
136
|
+
* The URL this Media instance represents.
|
137
|
+
*/
|
138
|
+
url;
|
139
|
+
/**
|
140
|
+
* Shorthand for {@link module:utils/locale~Locale#t}.
|
141
|
+
*
|
142
|
+
* @see module:utils/locale~Locale#t
|
143
|
+
*/
|
144
|
+
_locale;
|
145
|
+
/**
|
146
|
+
* The output of the `RegExp.match` which validated the {@link #url} of this media.
|
147
|
+
*/
|
148
|
+
_match;
|
149
|
+
/**
|
150
|
+
* The function returning the HTML string preview of this media.
|
151
|
+
*/
|
152
|
+
_previewRenderer;
|
123
153
|
constructor(locale, url, match, previewRenderer) {
|
124
154
|
this.url = this._getValidUrl(url);
|
125
155
|
this._locale = locale;
|
@@ -177,7 +207,7 @@ class Media {
|
|
177
207
|
_getPlaceholderHtml() {
|
178
208
|
const icon = new IconView();
|
179
209
|
const t = this._locale.t;
|
180
|
-
icon.content =
|
210
|
+
icon.content = IconMediaPlaceholder;
|
181
211
|
icon.viewBox = mediaPlaceholderIconViewBox;
|
182
212
|
const placeholder = new Template({
|
183
213
|
tag: 'div',
|
package/src/ui/mediaformview.js
CHANGED
@@ -17,6 +17,31 @@ import '../../theme/mediaform.css';
|
|
17
17
|
* See {@link module:media-embed/ui/mediaformview~MediaFormView}.
|
18
18
|
*/
|
19
19
|
export default class MediaFormView extends View {
|
20
|
+
/**
|
21
|
+
* Tracks information about the DOM focus in the form.
|
22
|
+
*/
|
23
|
+
focusTracker;
|
24
|
+
/**
|
25
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
26
|
+
*/
|
27
|
+
keystrokes;
|
28
|
+
/**
|
29
|
+
* The URL input view.
|
30
|
+
*/
|
31
|
+
urlInputView;
|
32
|
+
/**
|
33
|
+
* An array of form validators used by {@link #isValid}.
|
34
|
+
*/
|
35
|
+
_validators;
|
36
|
+
/**
|
37
|
+
* The default info text for the {@link #urlInputView}.
|
38
|
+
*/
|
39
|
+
_urlInputViewInfoDefault;
|
40
|
+
/**
|
41
|
+
* The info text with an additional tip for the {@link #urlInputView},
|
42
|
+
* displayed when the input has some value.
|
43
|
+
*/
|
44
|
+
_urlInputViewInfoTip;
|
20
45
|
/**
|
21
46
|
* @param validators Form validators used by {@link #isValid}.
|
22
47
|
* @param locale The localization services instance.
|
@@ -1,20 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!-- Generator: Adobe Illustrator 20.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4
|
-
viewBox="0 0 400 400" style="enable-background:new 0 0 400 400;" xml:space="preserve">
|
5
|
-
<style type="text/css">
|
6
|
-
.st0{fill:#1DA1F2;}
|
7
|
-
.st1{fill:#FFFFFF;}
|
8
|
-
</style>
|
9
|
-
<g id="Dark_Blue">
|
10
|
-
<circle class="st0" cx="200" cy="200" r="200"/>
|
11
|
-
</g>
|
12
|
-
<g id="Logo__x2014__FIXED">
|
13
|
-
<path class="st1" d="M163.4,305.5c88.7,0,137.2-73.5,137.2-137.2c0-2.1,0-4.2-0.1-6.2c9.4-6.8,17.6-15.3,24.1-25
|
14
|
-
c-8.6,3.8-17.9,6.4-27.7,7.6c10-6,17.6-15.4,21.2-26.7c-9.3,5.5-19.6,9.5-30.6,11.7c-8.8-9.4-21.3-15.2-35.2-15.2
|
15
|
-
c-26.6,0-48.2,21.6-48.2,48.2c0,3.8,0.4,7.5,1.3,11c-40.1-2-75.6-21.2-99.4-50.4c-4.1,7.1-6.5,15.4-6.5,24.2
|
16
|
-
c0,16.7,8.5,31.5,21.5,40.1c-7.9-0.2-15.3-2.4-21.8-6c0,0.2,0,0.4,0,0.6c0,23.4,16.6,42.8,38.7,47.3c-4,1.1-8.3,1.7-12.7,1.7
|
17
|
-
c-3.1,0-6.1-0.3-9.1-0.9c6.1,19.2,23.9,33.1,45,33.5c-16.5,12.9-37.3,20.6-59.9,20.6c-3.9,0-7.7-0.2-11.5-0.7
|
18
|
-
C110.8,297.5,136.2,305.5,163.4,305.5"/>
|
19
|
-
</g>
|
20
|
-
</svg>
|
@@ -1 +0,0 @@
|
|
1
|
-
<svg viewBox="0 0 64 42" xmlns="http://www.w3.org/2000/svg"><path d="M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098-2.506.668-4.538-.083-4.538-1.678 0-1.594 2.032-3.43 4.538-4.098.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556A1.014 1.014 0 0 0 49 17h-1.574zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.994 1.994 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805V17zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17zm29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155h18.692zM20.6 21.375v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616V37.53H20.6zm24.233-16.155v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615V37.53h-1.615zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35v-9.956z"/></svg>
|
package/theme/icons/media.svg
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
<svg viewBox="0 0 22 20" xmlns="http://www.w3.org/2000/svg"><path d="M1.587 1.5c-.612 0-.601-.029-.601.551v14.84c0 .59-.01.559.591.559h18.846c.602 0 .591.03.591-.56V2.052c0-.58.01-.55-.591-.55H1.587Zm.701.971h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-14.24 1h13.008v12H4.467l.029-12Zm-2.208 1h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h1.003v1H2.288v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h1.003l-.029 1h-.974v-1Zm16.448 0h1.003v1h-1.003v-1Zm-16.448 2h.974v1h-.974v-1Zm16.448 0h1.003v1h-1.003v-1Z"/><path d="M8.374 6.648a.399.399 0 0 1 .395-.4.402.402 0 0 1 .2.049l5.148 2.824a.4.4 0 0 1 0 .7l-5.148 2.824a.403.403 0 0 1-.595-.35V6.648Z"/></svg>
|