@ckeditor/ckeditor5-media-embed 41.4.1 → 42.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/README.md +6 -0
- package/build/media-embed.js +2 -2
- package/build/translations/ar.js +1 -1
- package/build/translations/az.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.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/es.js +1 -1
- package/build/translations/et.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/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/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.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/ne.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.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/sk.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/tk.js +1 -1
- package/build/translations/tr.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/dist/index-editor.css +5 -0
- package/dist/index.css +6 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +436 -379
- package/dist/index.js.map +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- 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/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/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/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/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/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/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/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/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/sk.js +1 -1
- package/dist/translations/sk.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/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/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/dist/types/mediaembedui.d.ts +9 -2
- package/dist/types/ui/mediaformview.d.ts +2 -28
- package/lang/contexts.json +1 -0
- package/lang/translations/ar.po +4 -0
- package/lang/translations/az.po +4 -0
- package/lang/translations/bg.po +4 -0
- package/lang/translations/bn.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/es.po +4 -0
- package/lang/translations/et.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/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/id.po +4 -0
- package/lang/translations/it.po +4 -0
- package/lang/translations/ja.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/ne.po +4 -0
- package/lang/translations/nl.po +4 -0
- package/lang/translations/no.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/sk.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/tk.po +4 -0
- package/lang/translations/tr.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 +3 -3
- package/src/mediaembedui.d.ts +9 -2
- package/src/mediaembedui.js +73 -50
- package/src/ui/mediaformview.d.ts +2 -28
- package/src/ui/mediaformview.js +8 -69
- package/theme/mediaform.css +6 -0
package/lang/translations/pl.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Wstaw media"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Pasek narzędzi mediów"
|
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Inserir mídia"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Ferramentas de Mídia"
|
package/lang/translations/pt.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Inserir media"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Barra de ferramentas de media"
|
package/lang/translations/ro.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Inserează media"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Bară media"
|
package/lang/translations/ru.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Вставить медиа"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Панель инструментов медиа"
|
package/lang/translations/sk.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Vložiť média"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Nástroje pre médiá"
|
package/lang/translations/sq.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Shto Medie"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Kokështrirja e mediave"
|
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Dodaj media"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Mediji traka sa alatkama"
|
package/lang/translations/sr.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Додај медиа"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Медији трака са алаткама"
|
package/lang/translations/sv.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Lägg in media"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Medieverktygsfält"
|
package/lang/translations/th.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "แทรกสื่อ"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "แถบเครื่องมือสื่อ"
|
package/lang/translations/tk.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Mediýa goýuň"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Mediýa gurallar paneli"
|
package/lang/translations/tr.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Medya Ekle"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Medya araç çubuğu"
|
package/lang/translations/uk.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Вставити медіа"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Панель інструментів медіа"
|
package/lang/translations/ur.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "میڈیا نصب کریں"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "آلہ جات برائے میڈیا"
|
package/lang/translations/uz.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Mediani joylashtiring"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Media asboblar paneli"
|
package/lang/translations/vi.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "Chèn đa phương tiện"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "Thanh công cụ đa phương tiện"
|
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "插入媒体"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "媒体工具栏"
|
package/lang/translations/zh.po
CHANGED
@@ -45,6 +45,10 @@ msgctxt "Toolbar button tooltip for the Media Embed feature."
|
|
45
45
|
msgid "Insert media"
|
46
46
|
msgstr "插入影音"
|
47
47
|
|
48
|
+
msgctxt "Label describing type of the inserted content (e.g. 'insert media')."
|
49
|
+
msgid "Media"
|
50
|
+
msgstr ""
|
51
|
+
|
48
52
|
msgctxt "The label used by assistive technologies describing an image toolbar attached to an image widget."
|
49
53
|
msgid "Media toolbar"
|
50
54
|
msgstr "影音工具"
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-media-embed",
|
3
|
-
"version": "
|
3
|
+
"version": "42.0.0-alpha.0",
|
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": "
|
17
|
-
"ckeditor5": "
|
16
|
+
"@ckeditor/ckeditor5-ui": "42.0.0-alpha.0",
|
17
|
+
"ckeditor5": "42.0.0-alpha.0"
|
18
18
|
},
|
19
19
|
"author": "CKSource (http://cksource.com/)",
|
20
20
|
"license": "GPL-2.0-or-later",
|
package/src/mediaembedui.d.ts
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
* @module media-embed/mediaembedui
|
7
7
|
*/
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
9
|
+
import { Dialog } from 'ckeditor5/src/ui.js';
|
9
10
|
import MediaEmbedEditing from './mediaembedediting.js';
|
10
11
|
/**
|
11
12
|
* The media embed UI plugin.
|
@@ -14,14 +15,20 @@ export default class MediaEmbedUI extends Plugin {
|
|
14
15
|
/**
|
15
16
|
* @inheritDoc
|
16
17
|
*/
|
17
|
-
static get requires(): readonly [typeof MediaEmbedEditing];
|
18
|
+
static get requires(): readonly [typeof MediaEmbedEditing, typeof Dialog];
|
18
19
|
/**
|
19
20
|
* @inheritDoc
|
20
21
|
*/
|
21
22
|
static get pluginName(): "MediaEmbedUI";
|
23
|
+
private _formView;
|
22
24
|
/**
|
23
25
|
* @inheritDoc
|
24
26
|
*/
|
25
27
|
init(): void;
|
26
|
-
|
28
|
+
/**
|
29
|
+
* Creates a button for menu bar that will show media embed dialog.
|
30
|
+
*/
|
31
|
+
private _createDialogButton;
|
32
|
+
private _showDialog;
|
33
|
+
private _handleSubmitForm;
|
27
34
|
}
|
package/src/mediaembedui.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* @module media-embed/mediaembedui
|
7
7
|
*/
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
9
|
-
import {
|
9
|
+
import { ButtonView, CssTransitionDisablerMixin, MenuBarMenuListItemButtonView, Dialog } from 'ckeditor5/src/ui.js';
|
10
10
|
import MediaFormView from './ui/mediaformview.js';
|
11
11
|
import MediaEmbedEditing from './mediaembedediting.js';
|
12
12
|
import mediaIcon from '../theme/icons/media.svg';
|
@@ -18,7 +18,7 @@ export default class MediaEmbedUI extends Plugin {
|
|
18
18
|
* @inheritDoc
|
19
19
|
*/
|
20
20
|
static get requires() {
|
21
|
-
return [MediaEmbedEditing];
|
21
|
+
return [MediaEmbedEditing, Dialog];
|
22
22
|
}
|
23
23
|
/**
|
24
24
|
* @inheritDoc
|
@@ -31,61 +31,84 @@ export default class MediaEmbedUI extends Plugin {
|
|
31
31
|
*/
|
32
32
|
init() {
|
33
33
|
const editor = this.editor;
|
34
|
+
editor.ui.componentFactory.add('mediaEmbed', () => {
|
35
|
+
const t = this.editor.locale.t;
|
36
|
+
const button = this._createDialogButton(ButtonView);
|
37
|
+
button.tooltip = true;
|
38
|
+
button.label = t('Insert media');
|
39
|
+
return button;
|
40
|
+
});
|
41
|
+
editor.ui.componentFactory.add('menuBar:mediaEmbed', () => {
|
42
|
+
const t = this.editor.locale.t;
|
43
|
+
const button = this._createDialogButton(MenuBarMenuListItemButtonView);
|
44
|
+
button.label = t('Media');
|
45
|
+
return button;
|
46
|
+
});
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* Creates a button for menu bar that will show media embed dialog.
|
50
|
+
*/
|
51
|
+
_createDialogButton(ButtonClass) {
|
52
|
+
const editor = this.editor;
|
53
|
+
const buttonView = new ButtonClass(editor.locale);
|
34
54
|
const command = editor.commands.get('mediaEmbed');
|
35
|
-
editor.
|
36
|
-
|
37
|
-
|
38
|
-
|
55
|
+
const dialogPlugin = this.editor.plugins.get('Dialog');
|
56
|
+
buttonView.icon = mediaIcon;
|
57
|
+
buttonView.bind('isEnabled').to(command, 'isEnabled');
|
58
|
+
buttonView.on('execute', () => {
|
59
|
+
if (dialogPlugin.id === 'mediaEmbed') {
|
60
|
+
dialogPlugin.hide();
|
61
|
+
}
|
62
|
+
else {
|
63
|
+
this._showDialog();
|
64
|
+
}
|
39
65
|
});
|
66
|
+
return buttonView;
|
40
67
|
}
|
41
|
-
|
68
|
+
_showDialog() {
|
42
69
|
const editor = this.editor;
|
43
|
-
const
|
44
|
-
const
|
45
|
-
const
|
46
|
-
|
47
|
-
const
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
70
|
+
const dialog = editor.plugins.get('Dialog');
|
71
|
+
const command = editor.commands.get('mediaEmbed');
|
72
|
+
const t = editor.locale.t;
|
73
|
+
if (!this._formView) {
|
74
|
+
const registry = editor.plugins.get(MediaEmbedEditing).registry;
|
75
|
+
this._formView = new (CssTransitionDisablerMixin(MediaFormView))(getFormValidators(editor.t, registry), editor.locale);
|
76
|
+
this._formView.on('submit', () => this._handleSubmitForm());
|
77
|
+
}
|
78
|
+
dialog.show({
|
79
|
+
id: 'mediaEmbed',
|
80
|
+
title: t('Insert media'),
|
81
|
+
content: this._formView,
|
82
|
+
isModal: true,
|
83
|
+
onShow: () => {
|
84
|
+
this._formView.url = command.value || '';
|
85
|
+
this._formView.resetFormStatus();
|
86
|
+
this._formView.urlInputView.fieldView.select();
|
87
|
+
},
|
88
|
+
actionButtons: [
|
89
|
+
{
|
90
|
+
label: t('Cancel'),
|
91
|
+
withText: true,
|
92
|
+
onExecute: () => dialog.hide()
|
93
|
+
},
|
94
|
+
{
|
95
|
+
label: t('Accept'),
|
96
|
+
class: 'ck-button-action',
|
97
|
+
withText: true,
|
98
|
+
onExecute: () => this._handleSubmitForm()
|
67
99
|
}
|
68
|
-
|
69
|
-
dropdown.on('change:isOpen', () => form.resetFormStatus());
|
70
|
-
dropdown.on('cancel', () => {
|
71
|
-
editor.editing.view.focus();
|
72
|
-
});
|
73
|
-
form.delegate('submit', 'cancel').to(dropdown);
|
74
|
-
form.urlInputView.fieldView.bind('value').to(command, 'value');
|
75
|
-
// Update balloon position when form error changes.
|
76
|
-
form.urlInputView.on('change:errorText', () => {
|
77
|
-
editor.ui.update();
|
78
|
-
});
|
79
|
-
// Form elements should be read-only when corresponding commands are disabled.
|
80
|
-
form.urlInputView.bind('isEnabled').to(command, 'isEnabled');
|
81
|
-
});
|
82
|
-
dropdown.bind('isEnabled').to(command);
|
83
|
-
button.set({
|
84
|
-
label: t('Insert media'),
|
85
|
-
icon: mediaIcon,
|
86
|
-
tooltip: true
|
100
|
+
]
|
87
101
|
});
|
88
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
|
+
}
|
89
112
|
}
|
90
113
|
function getFormValidators(t, registry) {
|
91
114
|
return [
|
@@ -5,7 +5,7 @@
|
|
5
5
|
/**
|
6
6
|
* @module media-embed/ui/mediaformview
|
7
7
|
*/
|
8
|
-
import { type InputTextView,
|
8
|
+
import { type InputTextView, LabeledFieldView, View } from 'ckeditor5/src/ui.js';
|
9
9
|
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
10
10
|
import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
|
11
11
|
import '../../theme/mediaform.css';
|
@@ -31,22 +31,6 @@ export default class MediaFormView extends View {
|
|
31
31
|
* The URL input view.
|
32
32
|
*/
|
33
33
|
urlInputView: LabeledFieldView<InputTextView>;
|
34
|
-
/**
|
35
|
-
* The Save button view.
|
36
|
-
*/
|
37
|
-
saveButtonView: ButtonView;
|
38
|
-
/**
|
39
|
-
* The Cancel button view.
|
40
|
-
*/
|
41
|
-
cancelButtonView: ButtonView;
|
42
|
-
/**
|
43
|
-
* A collection of views that can be focused in the form.
|
44
|
-
*/
|
45
|
-
private readonly _focusables;
|
46
|
-
/**
|
47
|
-
* Helps cycling over {@link #_focusables} in the form.
|
48
|
-
*/
|
49
|
-
private readonly _focusCycler;
|
50
34
|
/**
|
51
35
|
* An array of form validators used by {@link #isValid}.
|
52
36
|
*/
|
@@ -74,7 +58,7 @@ export default class MediaFormView extends View {
|
|
74
58
|
*/
|
75
59
|
destroy(): void;
|
76
60
|
/**
|
77
|
-
* Focuses the
|
61
|
+
* Focuses the {@link #urlInputView}.
|
78
62
|
*/
|
79
63
|
focus(): void;
|
80
64
|
/**
|
@@ -102,14 +86,4 @@ export default class MediaFormView extends View {
|
|
102
86
|
* @returns Labeled input view instance.
|
103
87
|
*/
|
104
88
|
private _createUrlInput;
|
105
|
-
/**
|
106
|
-
* Creates a button view.
|
107
|
-
*
|
108
|
-
* @param label The button label.
|
109
|
-
* @param icon The button icon.
|
110
|
-
* @param className The additional button CSS class name.
|
111
|
-
* @param eventName An event name that the `ButtonView#execute` event will be delegated to.
|
112
|
-
* @returns The button view instance.
|
113
|
-
*/
|
114
|
-
private _createButton;
|
115
89
|
}
|
package/src/ui/mediaformview.js
CHANGED
@@ -5,9 +5,8 @@
|
|
5
5
|
/**
|
6
6
|
* @module media-embed/ui/mediaformview
|
7
7
|
*/
|
8
|
-
import {
|
8
|
+
import { LabeledFieldView, View, createLabeledInputText, submitHandler } from 'ckeditor5/src/ui.js';
|
9
9
|
import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';
|
10
|
-
import { icons } from 'ckeditor5/src/core.js';
|
11
10
|
// See: #8833.
|
12
11
|
// eslint-disable-next-line ckeditor5-rules/ckeditor-imports
|
13
12
|
import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
|
@@ -24,26 +23,10 @@ export default class MediaFormView extends View {
|
|
24
23
|
*/
|
25
24
|
constructor(validators, locale) {
|
26
25
|
super(locale);
|
27
|
-
const t = locale.t;
|
28
26
|
this.focusTracker = new FocusTracker();
|
29
27
|
this.keystrokes = new KeystrokeHandler();
|
30
28
|
this.set('mediaURLInputValue', '');
|
31
29
|
this.urlInputView = this._createUrlInput();
|
32
|
-
this.saveButtonView = this._createButton(t('Save'), icons.check, 'ck-button-save');
|
33
|
-
this.saveButtonView.type = 'submit';
|
34
|
-
this.cancelButtonView = this._createButton(t('Cancel'), icons.cancel, 'ck-button-cancel', 'cancel');
|
35
|
-
this._focusables = new ViewCollection();
|
36
|
-
this._focusCycler = new FocusCycler({
|
37
|
-
focusables: this._focusables,
|
38
|
-
focusTracker: this.focusTracker,
|
39
|
-
keystrokeHandler: this.keystrokes,
|
40
|
-
actions: {
|
41
|
-
// Navigate form fields backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.
|
42
|
-
focusPrevious: 'shift + tab',
|
43
|
-
// Navigate form fields forwards using the <kbd>Tab</kbd> key.
|
44
|
-
focusNext: 'tab'
|
45
|
-
}
|
46
|
-
});
|
47
30
|
this._validators = validators;
|
48
31
|
this.setTemplate({
|
49
32
|
tag: 'form',
|
@@ -56,9 +39,7 @@ export default class MediaFormView extends View {
|
|
56
39
|
tabindex: '-1'
|
57
40
|
},
|
58
41
|
children: [
|
59
|
-
this.urlInputView
|
60
|
-
this.saveButtonView,
|
61
|
-
this.cancelButtonView
|
42
|
+
this.urlInputView
|
62
43
|
]
|
63
44
|
});
|
64
45
|
}
|
@@ -70,27 +51,10 @@ export default class MediaFormView extends View {
|
|
70
51
|
submitHandler({
|
71
52
|
view: this
|
72
53
|
});
|
73
|
-
|
74
|
-
|
75
|
-
this.saveButtonView,
|
76
|
-
this.cancelButtonView
|
77
|
-
];
|
78
|
-
childViews.forEach(v => {
|
79
|
-
// Register the view as focusable.
|
80
|
-
this._focusables.add(v);
|
81
|
-
// Register the view in the focus tracker.
|
82
|
-
this.focusTracker.add(v.element);
|
83
|
-
});
|
54
|
+
// Register the view in the focus tracker.
|
55
|
+
this.focusTracker.add(this.urlInputView.element);
|
84
56
|
// Start listening for the keystrokes coming from #element.
|
85
57
|
this.keystrokes.listenTo(this.element);
|
86
|
-
const stopPropagation = (data) => data.stopPropagation();
|
87
|
-
// Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's
|
88
|
-
// keystroke handler would take over the key management in the URL input. We need to prevent
|
89
|
-
// this ASAP. Otherwise, the basic caret movement using the arrow keys will be impossible.
|
90
|
-
this.keystrokes.set('arrowright', stopPropagation);
|
91
|
-
this.keystrokes.set('arrowleft', stopPropagation);
|
92
|
-
this.keystrokes.set('arrowup', stopPropagation);
|
93
|
-
this.keystrokes.set('arrowdown', stopPropagation);
|
94
58
|
}
|
95
59
|
/**
|
96
60
|
* @inheritDoc
|
@@ -101,10 +65,10 @@ export default class MediaFormView extends View {
|
|
101
65
|
this.keystrokes.destroy();
|
102
66
|
}
|
103
67
|
/**
|
104
|
-
* Focuses the
|
68
|
+
* Focuses the {@link #urlInputView}.
|
105
69
|
*/
|
106
70
|
focus() {
|
107
|
-
this.
|
71
|
+
this.urlInputView.focus();
|
108
72
|
}
|
109
73
|
/**
|
110
74
|
* The native DOM `value` of the {@link #urlInputView} element.
|
@@ -116,7 +80,7 @@ export default class MediaFormView extends View {
|
|
116
80
|
return this.urlInputView.fieldView.element.value.trim();
|
117
81
|
}
|
118
82
|
set url(url) {
|
119
|
-
this.urlInputView.fieldView.
|
83
|
+
this.urlInputView.fieldView.value = url.trim();
|
120
84
|
}
|
121
85
|
/**
|
122
86
|
* Validates the form and returns `false` when some fields are invalid.
|
@@ -157,6 +121,7 @@ export default class MediaFormView extends View {
|
|
157
121
|
this._urlInputViewInfoTip = t('Tip: Paste the URL into the content to embed faster.');
|
158
122
|
labeledInput.label = t('Media URL');
|
159
123
|
labeledInput.infoText = this._urlInputViewInfoDefault;
|
124
|
+
inputField.inputMode = 'url';
|
160
125
|
inputField.on('input', () => {
|
161
126
|
// Display the tip text only when there is some value. Otherwise fall back to the default info text.
|
162
127
|
labeledInput.infoText = inputField.element.value ? this._urlInputViewInfoTip : this._urlInputViewInfoDefault;
|
@@ -164,30 +129,4 @@ export default class MediaFormView extends View {
|
|
164
129
|
});
|
165
130
|
return labeledInput;
|
166
131
|
}
|
167
|
-
/**
|
168
|
-
* Creates a button view.
|
169
|
-
*
|
170
|
-
* @param label The button label.
|
171
|
-
* @param icon The button icon.
|
172
|
-
* @param className The additional button CSS class name.
|
173
|
-
* @param eventName An event name that the `ButtonView#execute` event will be delegated to.
|
174
|
-
* @returns The button view instance.
|
175
|
-
*/
|
176
|
-
_createButton(label, icon, className, eventName) {
|
177
|
-
const button = new ButtonView(this.locale);
|
178
|
-
button.set({
|
179
|
-
label,
|
180
|
-
icon,
|
181
|
-
tooltip: true
|
182
|
-
});
|
183
|
-
button.extendTemplate({
|
184
|
-
attributes: {
|
185
|
-
class: className
|
186
|
-
}
|
187
|
-
});
|
188
|
-
if (eventName) {
|
189
|
-
button.delegate('execute').to(this, eventName);
|
190
|
-
}
|
191
|
-
return button;
|
192
|
-
}
|
193
132
|
}
|
package/theme/mediaform.css
CHANGED
@@ -10,15 +10,21 @@
|
|
10
10
|
align-items: flex-start;
|
11
11
|
flex-direction: row;
|
12
12
|
flex-wrap: nowrap;
|
13
|
+
width: 400px;
|
13
14
|
|
14
15
|
& .ck-labeled-field-view {
|
15
16
|
display: inline-block;
|
17
|
+
width: 100%;
|
16
18
|
}
|
17
19
|
|
18
20
|
& .ck-label {
|
19
21
|
display: none;
|
20
22
|
}
|
21
23
|
|
24
|
+
& .ck-input {
|
25
|
+
width: 100%;
|
26
|
+
}
|
27
|
+
|
22
28
|
@mixin ck-media-phone {
|
23
29
|
flex-wrap: wrap;
|
24
30
|
|